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.
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."