Alan Sheehan's 89th-minute winner re-ignited Notts County's play-off bid at the expense of Oldham.
The Latics came closest to opening the scoring in the first half when Chris Taylor's 40-yard shot crashed against Stuart Nelson's upright.
Lee Hughes should have put the Magpies in front but headed straight at Dean Bouzanis in the second half.
But Sheehan grabbed all three points when he applied the finish to Lloyd Sam's tricky run and cut-back.
The victory ended a run of three games without a win for Notts and moved them to within four points of the League One play-off places.
VIEWS FROM THE DRESSING ROOM
Notts County manager Keith Curle told BBC Radio Nottingham:
"I think that goes a long way to show how far I've got to go to earn the trust, the respect and the understanding of the supporters.
"Every decision I make is for this football club. I don't bring players off for the sake of bringing players off.
"I certainly won't stop bringing players off just because a certain section of the crowd might start booing because it might be a crowd favourite.
"Every decision that I make will be what I think in my opinion is going to be for the better of the football team.
"Why? Because my reputation depends on the decisions I make and I'm a brave person, I make decisions, again for the right reasons.
"I don't like to get booed - it's not nice - but I know that the players trust in the decisions that I make, that they believe in the decisions that I make, there's good understanding that, again, everything I do is for the right reasons.
"The crowd will grow to understand the decisions I make are made for the right reasons."
Oldham manager Paul Dickov told BBC Radio Manchester:
"Maybe it's me being a little bit young and naive, but I didn't see that coming.
"I thought we were by far the better team throughout the game, I thought we played the better football and we were unlucky not to score one or two goals.
"Never mind not getting a point, I feel aggrieved not to have won the game.
"As disappointed as I am at losing the game, I've got lots of positives to take from it."