Craig Mackail-Smith raced beyond 20 league goals for the season as Peterborough kept up their remarkable winning run.
Mackail-Smith produced two close-range finishes - the second after a defensive howler from Oldham - to make it seven straight victories for his team.
Posh rode their luck against an Oldham side who had a goal dubiously ruled out just after they had pulled level through Chris Taylor.
Defeat effectively ended Oldham's play-off hopes, but in-form Peterborough could yet snatch the League One title from Leicester.
Oldham almost made the breakthrough on 15 minutes as Reuben Hazell's touch from a set-piece was hacked off the goalline by Dean Keates.
But the visitors were always a threat going forward and they capitalised after 26 minutes when Paul Coutts crossed from the right and the ball cannoned off Oldham full-back Neil Eardley before Mackail-Smith slotted into the bottom corner from eight yards.
Peterborough keeper Joe Lewis made a fine save from Daniel Jones, but his side continued to drive forward and had chances for Aaron McLean and Mackail-Smith, who headed wide from the six-yard line when it looked easier to score.
Oldham equalised two minutes before the break as Eardley sent in a teasing right-wing free kick and Taylor jumped at the near post to glance it home for his 11th strike of the season.
Taylor, usually a winger but playing upfront due to Oldham's injury problems, was also involved in the move which saw Lewis Alessandra fire home in first-half injury time only for referee Graham Salisbury to disallow the effort for a foul.
Both sides played attractive football in an entertaining second half but Taylor wasted two chances and Mackail-Smith again failed to hit the target from close range.
Taylor had a great opportunity entering the last ten minutes but his first-time shot lacked power to trouble Lewis.
The winner arrived four minutes from time when Eardley got in a tangle with keeper Shane Supple and inadvertently set up Mackail-Smith, who tapped into the empty net from six yards for his 21st goal this term in the league.