Keanu Marsh-Brown clinched Dons’ ninth away victory of the season when his second-half shot took a wicked deflection off Oldham defender Aidan White.
Adam Clayton had a key role in the opening goal on 28 minutes, hitting a through ball which Oldham’s Carl Winchester deflected to Angelo Balanta for a cool finish from 14 yards.
Balanta’s strike was quickly followed by an equaliser as Winchester seized possession outside the box and unleashed a fierce drive into the top corner for his first senior goal.
But Balanta headed against the bar from Lewis Guy’s cross and Dons regained the lead from 50 minutes when Marsh-Brown’s 20-yard shot glanced off White and spun into the far corner.
Oldham manager Paul Dickov made a late appearance from the bench to end his playing career at the age of 38.