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."
Stevenage 16 Day 03 Laird 04 Charles 05 Ashton 14 Roberts 02 Wilson 13 Byrom Booked 24 Bostwick 10 Reid (Myrie-Williams - 81' ) 15 Freeman (Lascelles - 69' ) 27 Slew (Agyemang - 63' ) Substitutes 01 Julian 30 Lascelles 11 Myrie-Williams 32 Shroot 29 Agyemang Oldham 01 Cisak 02 Mvoto 05 Diamond (Tarkowski - 14' ) 06 Brown 07 Morais 11 Adeyemi 18 Taylor 19 Lee 20 M'changama 09 Reid (Smith - 82' ) 32 Kuqi Substitutes 13 Bouzanis 16 Tarkowski 26 Winchester 29 Mellor 14 Smith