The hosts looked set to narrow the gap to second-placed Sheffield Wednesday to just four points when Shaun Williams fired them in front in the 80th minute from the penalty spot.
But Cook struck back within three minutes and netted the winner also from the spot in injury time after he was adjudged to have been fouled by Dons defender Tom Flanagan.
Carlisle's win kept them in the play-off zone at the expense of Stevenage, who came from 2-0 down to grab a 2-2 home draw with Bournemouth.
Wesley Thomas and Scott Malone gave the Cherries the lead inside 36 minutes, but Luke Freeman and Michael Bostwick still managed to bring Stevenage level before half-time.
At the bottom, Walsall clambered out of the relegation zone with a 3-1 win over Colchester. Anthony Wordsworth gave the visitors an early lead but the Saddlers responded through Emanuel Ledesma, Mat Sadler and George Bowerman.
Brentford kept their slim play-off hopes alive with a 3-1 win at Preston. Shaleum Logan and Clayton Donaldson gave the Bees an early lead, Paul Parry's penalty reduced the deficit before Donaldson's second secured the points.
David Mooney scored the only goal of the game as Leyton Orient won 1-0 at Oldham, despite the late sending-off of defender Ryan Dickson for two bookable offences.