The Cumbrians appeared to have done the hard work against a lively Posh side when they went 3-1 ahead just after half-time.
However the visitors staged a tremendous rally and only poor finishing and some great work by Carlisle's on-loan goalkeeper Ben Alnwick kept them out until Mackail-Smith burst through seconds from the end to slide the ball home from close range.
The Cumbrians took the lead in the 20th minute when Simon Hackney's cross from the left was cleverly chested down by Danny Carlton into the path of Danny Graham and he neatly placed the ball wide of goalkeeper Joe Lewis from eight yards.
Posh equalised in the 34th minute when poor marking in the home defence allowed Charlie Lee space to score with a downward header from Russell Martin's corner. A fumble by Joe Lewis from Hackney's 18-yard shot let in Graham for his second of the game in the 50th minute.
The visitors' defence was all at sea as Graham Kavanagh coolly picked his spot to slide the ball home from just inside the area, before Posh pulled a goal back from the penalty spot in the 60th minute, Mackail-Smith rocketing his penalty past Alnwick after a handling offence in the box by Evan Horwood.