Baldock netted two headers in a minute to cancel out Scott Cuthbert’s first-half opener, before David Prutton saw red in the 88th minute for two bookings.
Cuthbert put Swindon ahead against the run of play on the stroke of half-time, outjumping Dietmar Hamann at the near post to head in Sean Morrison’s long throw.
The Dons piled forward in the closing stages of the League One clash and Hamann’s 30-yard chip was tipped over by Lucas before Danny Woodards planted a free header wide from Angelo Balanta’s corner.
But Milton Keynes were not to be denied and Baldock equalised in the 72nd minute when he headed in Dean Lewington’s cross at the near post.
And Baldock won it for the Dons a minute later when he nodded in the rebound from a yard after Sean O’Hanlon’s header had been parried by Lucas, before Prutton was sent off for fouling Baldock.