Midfielder Alex Russell climbed off the substitute's bench to crash in a spectacular winning goal for Northampton Town at Boundary Park.
And Russell, on loan from Bristol City, had been left out of the starting eleven as manager Stuart Gray shuffled his pack before scoring less than a minute after entering the fray.
Northampton had struggled to remain on level terms before half-time as Oldham wasted a number of chances to break the deadlock.
It was a different story afterwards as Russell netted in the 66th minute and the home side lurched towards their fourth defeat in six home games.
Northampton have not won away this season and they were under pressure after just five minutes as Oldham defender Neal Trotman headed just over the bar from an Andy Liddell corner.
Striker Craig Davies was guilty of a bad miss on 21 minutes as he chased a through ball from strike partner Michael Ricketts and rounded keeper Mark Bunn but could not convert from a tight angle.
Davies was among several Oldham players to try their luck from the edge of the box and he also blasted wide after an astute pass from Neal Eardley.
Bunn kept out a close-range header from Ricketts on the stroke of half-time, but Northampton started to gain a foothold and Russell fired them in front with their first shot on target.
There could have been another goal for the Cobblers as top-scorer Andy Kirk was denied by Oldham's on-loan keeper Marlon Beresford.
The home side were unable to carve out any more clear chances and their day was typified when Ricketts shot well wide in the last five minutes.