The Dons controlled much of the first half and soaked up second-half Tranmere pressure before securing victory with three minutes left.
Ryan Lowe missed a glorious chance to put them ahead when he found himself one-on-one with Owain Fon Williams in the eighth minute, but the former Bury man dragged his shot wide.
Jake Cassidy had Rovers' clearest chance after 28 minutes, but failed to convert James Wallace's superb centre when only 12 yards out.
Wallace tested Dons keeper David Martin early in the second half and was in the thick of the action again after 68 minutes, heading Dean Lewington's flick off the line with Fon Williams beaten.
But the Dons stole all three points when Gleeson followed up after Fon Williams could only parry Daniel Powell's cross and stabbed home from six yards.