Mackail-Smith hit a goal in each half to make it seven straight wins for Posh, who stay firmly on course for automatic promotion.
The striker made the breakthrough after 26 minutes, slotting into the bottom corner after a Paul Coutts cross from the right fell kindly inside the box.
Peterborough stayed on top but Oldham drew level against the run of play as Neal Eardley's free kick was glanced home from eight yards by Chris Taylor.
Mackail-Smith twice failed to hit the target from close range, while Taylor scuffed a fine opportunity straight at keeper Joe Lewis.
Peterborough's winner after 86 minutes was courtesy of a terrible defensive mix-up as Eardley headed past his own advancing keeper and Mackail-Smith tapped in to the empty net.