Lawrie Wilson scored an injury-time winner for Stevenage to down Oldham and take them to within two points of the play-off places.
Oldham had a chance in the first half when Tom Adeyemi received Boro keeper Chris Day's poor goal-kick but lobbed over from 30 yards.
After the break Craig Reid was denied by onrushing Latics keeper Alex Cisak.
But Cisak was beaten when Wilson met Darius Charles's right-wing cross with a diving header.
VIEWS FROM THE DRESSING ROOM
Stevenage manager Gary Smith told BBC Three Counties Radio:
"Somehow we had to get a result. It didn't matter how the result came. If we'd have won it 4-0 or 5-0 of course we'd have felt a lot better about it.
"We win the game in the last minute and it certainly feels euphoric because of the way the goal came about and the lateness of it.
"But the three points are very much the most important thing at this stage to try and take advantage of those games in hand."