Scott Taylor's dramatic 90th minute winner lifted the resurgent Dons off the bottom of the table for the first since Christmas.
Substitute Taylor converted off the inside of the post with just seconds remaining to seal the Dons' third straight win, after Michael Proctor had cancelled out Aaron Wilbraham's early opener for the Dons.
It was the first time the Dons have bagged three straight league wins since their move to Milton Keynes, as they leapfrogged Hartlepool and Walsall in the table.
The Dons started brightly and David Partridge headed Gary Smith's corner over the bar from nine yards before Wilbraham dragged Clive Platt's flick-on wide from the edge of the box.
The lively Wilbraham then tricked his way past two defenders but fired straight at Hartlepool goalkeeper Dimi Konstantopoulos from 15 yards before he broke the deadlock from close range in the 25th minute.
Smith picked himself up after being brought down by Stephen Turnbull on the edge of the box and slotted a quick free-kick through to Wilbraham, who stabbed in his seventh goal of the season at the near post.
Smith should have doubled the Dons' lead in the 48th minute when he fired Filipe Morais' pull-back straight at Konstantopoulos from 10 yards.
And Proctor made him pay by grabbing a controversial equaliser for Hartlepool two minutes later.
Williams appeared to jump into Baker as he leapt to collect a bouncing ball and when the Dons' keeper dropped it, Proctor lobbed into the open goal from 25-yards despite furious protests from the Dons' players and staff.
Baker superbly denied Mark Tinkler and Williams in a frantic finish, before Taylor collected substitute Izale McLeod's pass to fire in off the post from 10 yards with almost the last kick of the game.