The former QPR hitman turned in Jason Puncheon's cross nine minutes from time to ensure Roberto Di Matteo's men stay in the play-off places.
Hard-working visitors Tranmere will no doubt be disappointed. It was their first loss in five matches and they would have overtaken the Dons had they won.
Gallen on the other hand will be delighted. It was his first strike of the season and came after being on the field for a matter of seconds.
The first half was tight with the Dons keeping the ball for long periods, but being unable to create anything in the final third.
Sam Baldock almost went through on goal only to be crudely barged down by former Don Ben Chorley. From the resulting free-kick Baldock's shot was blocked.
It took half-an-hour for the first real chance of the game to come but surprisingly it fell for the visitors.
Chris Shuker's long and high cross to the back post was spilled by Lewis Price. The ball fell to Gareth Edds who somehow half-volleyed over from all of six yards.
And the Dons, who were looking a tad shaky at the back, gifted another chance to the visitors soon after.
Ian Moore read Jude Stirling's header back to Price and got a toe to the ball. It rolled through the keeper's legs but agonisingly for Rovers wide of the post.
MK Dons did finally create a chance of note in the last minute of the first half as Flavien Belson picked out Carl Regan's run from deep but the full-back shot wide of the post.
The Dons came out more determined for the second half but were finding it hard to create any clear-cut chances.
The home side had a decent penalty shout waved away after Luke Chadwick shot in a crowded area, and Alan Navarro hit a 30-yard shot just wide of the post.
It looked like it may never come but, with nine minutes left, Gallen popped up at the near post to convert Puncheon's corner.
The Dons could have sealed the victory in stoppage time when Chadwick tormented the Rovers defence and had a curling shot palmed out to Baldock whose rasping follow-up cannoned off the bar.