The result at Boundary Park means the Glovers need to win both of their remaining fixtures to stand any chance of automatic promotion.
Oldham are now five points clear of fourth-bottom Scunthorpe, who lost at bottom club Bury, and they also leap above Colchester into 19th position following the U's 2-0 home defeat by MK Dons.
But it spelt the end for Portsmouth and Hartlepool, who are now eight points adrift of safety with two games remaining.
Bristol City's six-season spell in the Championship came to an end with a home defeat by Birmingham.
Needing victory to avoid the drop to League One, the Robins fell behind when Wade Elliott slotted into the bottom corner after Nathan Redmond's run.
The home side missed a good chance to level when Sam Baldock fired narrowly wide from 20 yards after Steve Davies's knockdown.
But Blues held on to send Bristol City down with three games remaining