Matt Smith's header ensured Lee Johnson's Oldham beat father Gary's Yeovil and condemned both Hartlepool and Portsmouth to relegation.
Yeovil goalkeeper Marek Stech had earlier made a stunning save to keep out David Mellor's free kick.
But Smith nodded in the resulting Lee Croft corner to give Oldham a vital three points in their bid for survival.
Angelo Balanta wasted Yeovil's best chance, shooting wide in the first half with only Dean Bouzanis to beat.
The result at Boundary Park means the Glovers need to win both of their remaining fixtures to stand any chance of automatic promotion.
Oldham are now five points clear of fourth-bottom Scunthorpe, who lost at bottom club Bury, and they also leap above Colchester into 19th position following the U's 2-0 home defeat by MK Dons.
But it spelt the end for Portsmouth and Hartlepool, who are now eight points adrift of safety with two games remaining.
Much of the build-up to the game had centred around the two bosses - the first father and son to manage opposing teams in a Football League match since March 1971.
Father and son in the dugout
Lee and Gary Johnson became only the second father and son to face each other as opposing managers in the Football League.
Bill Dodgin (Bristol Rovers) and Bill Dodgin Jr (Fulham) are the only duo to have previously done so, the last of their meetings coming in 1971.
The pair exchanged embarrassed grins and a warm handshake prior to kick-off, but both were focused on the action immediately afterwards as Yeovil's Sam Foley fired narrowly wide with a fizzing effort from 25 yards inside the first minute.
After Balanta had spurned his golden opportunity to break the deadlock, giant Latics striker Smith came to the fore. He was a frequent target for Oldham long balls and a constant menace for the Yeovil defence.
One header had been cleared off the line by Yeovil centre-back Richard Hinds and another from close range had sailed over before Smith finally found the target with a near-post flick on the stroke of half-time.
The expected Yeovil onslaught did not materialise after the break and the second half was played out with few chances at either end, which suited a committed Latics side who moved a massive step closer to securing their League One status.
A weak header over from Latvian substitute Vitalijs Maksimenko and James Hayter's deflected shot were the only efforts of note for a Yeovil outfit who will now probably have to settle for the play-offs as they bid to reach the Championship for the first time in the club's history.
As for Johnson Jr, who exchanged a hug with his father at full-time, he knows that one win from Oldham's remaining three games will definitely be enough for survival.
VIEWS FROM THE DRESSING ROOM
Oldham Athletic manager Lee Johnson:
"It looks like we need a point [for survival].
"We've still got three important games and if we show that desire for the cause, we'll be OK.
"We had a little cuddle at the end of the game and I felt for him because I could feel he was upset, but at the same time the relief inside me took over that emotion.
"I hope they [Yeovil] go up through the play-offs. They're a good side and they can do. As far as we're concerned, that's such a big win and I'm so pleased to have got the three points."
Yeovil Town manager Gary Johnson:
"I'm really disappointed.
"Our team have generally done well during the season and I'm proud of what we've achieved, but every now and again our 'little boy lost' game comes out.
"It was just one of those days. I didn't enjoy the game because my team didn't perform.
"I'm pleased for Lee and pleased for his team because they deserved the victory. They had to be ready in case we were off form and we were off form tonight."
- 13 Bouzanis
- 02 Brown
- 03 Grounds
- 05 Mvoto
- 27 Belezika
- 07 Croft (Reid - 83' Booked )
- 23 K Smith
- 29 Mellor
- 10 Simpson Booked
- 14 M Smith (Millar - 78' Booked )
- 18 Barnard Booked
- 01 Cisak
- 26 Winchester
- 30 Cooper
- 22 Reid
- 09 Iwelumo
- 11 Montano
- 21 Millar
- 01 Stech
- 02 Ayling
- 04 Hinds (Maksimenko - 72' Booked )
- 05 Webster
- 20 Edwards
- 08 Upson
- 14 Foley (McAllister - 71' )
- 22 Dawson
- 09 Hayter Booked
- 17 Madden
- 29 Balanta (Williams - 46' Booked )
- 12 Stewart
- 03 McAllister
- 13 Maksimenko
- 16 Ralph
- 10 Williams
- 15 Young
Live Text Commentary
Full Time The referee ends the match.90:00 +3:17 Booking
Booking Vitalijs Maksimenko receives a caution.90:00 +3:00
Vitalijs Maksimenko gives away a free kick for an unfair challenge on Kirk Millar. Free kick taken by Robbie Simpson.90:00 +2:39
The ball is delivered by Luke Ayling, save made by Dean Bouzanis.90:00 +2:25
James McAllister crosses the ball, Jonathan Grounds makes a clearance.90:00 +2:04
Paddy Madden crosses the ball, save by Dean Bouzanis.90:00 +1:46
Inswinging corner taken left-footed by James McAllister, Robbie Simpson manages to make a clearance.90:00 +1:18
The ball is sent over by Kevin Dawson, James Hayter takes a shot. Jean Yves Mvoto gets a block in.89:50
Free kick awarded for a foul by Byron Webster on Robbie Simpson. The free kick is swung in left-footed by Kirk Millar, Marek Stech makes a comfortable save.88:58
Paddy Madden crosses the ball.88:29
Inswinging corner taken by James McAllister.87:54 Booking
Booking Robbie Simpson is shown a yellow card.87:35 Booking
Booking Kirk Millar is cautioned.86:53
Free kick awarded for a foul by Kirk Millar on Byron Webster. Free kick taken by James McAllister.85:11
Free kick awarded for a foul by Glenn Belezika on James Hayter. Edward Upson crosses the ball, Header from close range by Vitalijs Maksimenko clears the bar.84:30 Booking
Booking Caution for Bobby Reid.84:15
Bobby Reid concedes a free kick for a foul on James McAllister. Free kick taken by Marek Stech.82:58 Substitution
Substitution Bobby Reid on for Lee Croft.82:29
Connor Brown crosses the ball.81:39
Effort from outside the penalty box by Korey Smith goes wide right of the target.
Centre by Lee Croft, Luke Ayling manages to make a clearance.79:46
The ball is crossed by Kirk Millar, clearance made by Byron Webster.78:43
The ball is sent over by James McAllister. Korey Smith fouled by Byron Webster, the ref awards a free kick. Dean Bouzanis takes the free kick.76:37 Substitution
Substitution Kirk Millar joins the action as a substitute, replacing Matt Smith.76:37 Booking
Booking James Hayter goes into the referee's book for unsporting behaviour.76:28
Connor Brown fouled by James Hayter, the ref awards a free kick. Dean Bouzanis restarts play with the free kick.75:58
Paddy Madden takes a shot. Dean Bouzanis makes a comfortable save.75:12
James Hayter gives away a free kick for an unfair challenge on Connor Brown. Dean Bouzanis takes the free kick.74:50
James Hayter produces a cross, Robbie Simpson makes a clearance.74:25
Edward Upson takes a shot. Comfortable save by Dean Bouzanis.70:33 Substitution
Substitution Vitalijs Maksimenko replaces Richard Hinds.70:33 Substitution
Substitution James McAllister comes on in place of Sam Foley.70:33
Unfair challenge on Edward Upson by Lee Croft results in a free kick. Marek Stech takes the indirect free kick.69:24
James Hayter concedes a free kick for a foul on Connor Brown. The ball is sent over by David Mellor, Lee Barnard takes a shot. Save by Marek Stech.68:28
Inswinging corner taken right-footed by Lee Croft from the left by-line to the near post, Gavin Williams makes a clearance.68:11
Robbie Simpson delivers the ball, Luke Ayling gets a block in.67:25
Lee Croft crosses the ball in from the free kick, Joe Edwards makes a clearance.67:25 Booking
Booking The referee books Gavin Williams for unsporting behaviour.67:19
Lee Croft fouled by Gavin Williams, the ref awards a free kick.65:58
Paddy Madden is flagged offside by the assistant referee. Indirect free kick taken by Dean Bouzanis.64:39
Matt Smith is flagged offside by the assistant referee. Indirect free kick taken by Byron Webster.63:06
Corner taken by Sam Foley.61:29
The ball is sent over by Connor Brown. Robbie Simpson produces a cross.57:56
Luke Ayling produces a cross, save by Dean Bouzanis.55:49
Centre by Lee Croft, clearance made by Byron Webster.51:54
Gavin Williams produces a right-footed shot from a long way out which goes wide right of the goal.49:59
The assistant referee signals for offside against Matt Smith. Marek Stech restarts play with the free kick.49:51
The ball is delivered by Lee Croft.47:07
Free kick awarded for a foul by Lee Croft on Sam Foley. Marek Stech takes the free kick.46:07
Luke Ayling produces a cross, Jean Yves Mvoto makes a clearance.45:01
The second half has started.45:01 Substitution
Substitution Gavin Williams is brought on as a substitute for Angelo Balanta.45:00 +2:47 Half time
Half Time The first half comes to an end.45:00 +1:05
Lee Croft provided the assist for the goal.45:00 +1:05 Goal scored
Goal! - Matt Smith - Oldham 1 - 0 Yeovil Matt Smith scores a headed goal from close range. Oldham 1-0 Yeovil.45:00 +0:44
Corner taken right-footed by Lee Croft to the near post,44:43
Free kick awarded for an unfair challenge on Lee Croft by Paddy Madden. Shot on goal comes in from David Mellor from the free kick, save by Marek Stech.39:44
Inswinging corner taken from the left by-line by Sam Foley.38:47
Lee Barnard takes a shot. Richard Hinds gets a block in.37:30
A cross is delivered by Luke Ayling, clearance made by Glenn Belezika. Outswinging corner taken right-footed by Edward Upson from the right by-line, clearance made by Robbie Simpson.35:56 Booking
Booking Booking for Lee Barnard.35:41
Free kick awarded for a foul by Lee Barnard on Richard Hinds. Byron Webster restarts play with the free kick.35:07
Centre by Lee Croft, Matt Smith has a header from deep inside the six-yard box and clears the crossbar.34:04
Free kick awarded for an unfair challenge on Korey Smith by James Hayter. Dean Bouzanis takes the free kick.32:08
David Mellor takes a inswinging corner from the right by-line to the near post, Edward Upson makes a clearance.30:36
Unfair challenge on Kevin Dawson by David Mellor results in a free kick. Edward Upson takes the free kick.29:49
Free kick awarded for a foul by Jean Yves Mvoto on Angelo Balanta. Marek Stech restarts play with the free kick.29:30
The ball is swung over by Lee Barnard, Luke Ayling manages to make a clearance.28:23
Free kick awarded for an unfair challenge on Korey Smith by Kevin Dawson. Indirect free kick taken by Dean Bouzanis.27:28
Robbie Simpson challenges Angelo Balanta unfairly and gives away a free kick. Luke Ayling takes the direct free kick.27:04
Matt Smith has a headed effort at goal from just inside the area that misses to the right of the target.26:34
The referee blows for offside against Paddy Madden. Indirect free kick taken by Dean Bouzanis.25:51
Matt Smith takes a shot. Richard Hinds makes a clearance.23:55
Foul by Byron Webster on Lee Barnard, free kick awarded. The free kick is swung in left-footed by David Mellor, Luke Ayling fouled by Matt Smith, the ref awards a free kick. Marek Stech restarts play with the free kick.22:31
Lee Croft gives away a free kick for an unfair challenge on Edward Upson. Marek Stech restarts play with the free kick.22:22
The ball is swung over by Lee Croft.21:58
Lee Barnard gives away a free kick for an unfair challenge on Byron Webster. Free kick taken by Marek Stech.21:21
Shot by Angelo Balanta from deep inside the penalty area misses to the left of the target.21:08
Lee Croft crosses the ball, clearance by Byron Webster.20:32
Unfair challenge on Lee Barnard by Richard Hinds results in a free kick. Korey Smith takes the direct free kick.19:21
The assistant referee flags for offside against Richard Hinds. Free kick taken by Dean Bouzanis.18:49
Free kick awarded for an unfair challenge on Edward Upson by David Mellor. Luke Ayling restarts play with the free kick.17:39
James Hayter fouled by Connor Brown, the ref awards a free kick. Indirect free kick taken by Marek Stech.15:10
Centre by Korey Smith.14:36
David Mellor fouled by Edward Upson, the ref awards a free kick. Jean Yves Mvoto takes the free kick.12:23
The offside flag is raised against Paddy Madden. Indirect free kick taken by Dean Bouzanis.12:09
A cross is delivered by Lee Croft, Byron Webster makes a clearance.10:39
Jean Yves Mvoto gives away a free kick for an unfair challenge on Paddy Madden. Centre by Edward Upson, Joe Edwards takes a shot. Save by Dean Bouzanis.8:37
Free kick awarded for a foul by Lee Barnard on Luke Ayling. Free kick taken by Luke Ayling.8:20
The ball is delivered by Joe Edwards, clearance made by Lee Croft.7:28
The referee blows for offside. Indirect free kick taken by Marek Stech.5:19
Headed effort from inside the box by Matt Smith misses to the right of the target.5:01
The referee penalises Edward Upson for handball. Free kick taken by Dean Bouzanis.4:28
David Mellor challenges Edward Upson unfairly and gives away a free kick. Marek Stech takes the free kick.3:43
Shot from just outside the area by Paddy Madden misses to the left of the target.0:47
Sam Foley produces a right-footed shot from outside the penalty area and misses left.0:06
Kevin Dawson fouled by Korey Smith, the ref awards a free kick. Free kick taken by Luke Ayling.0:00
The referee starts the match.
Live data and text provided by our data suppliers