After a goalless first half, Nicky Maynard put the hosts in front four minutes after the break, the striker notching against the club he left at the end of last season.
With nine minutes left Cardiff were level as Craig Noone fired in his fourth of the season, but with just seconds left Murphy drilled home to earn the home side three points.
Sammy Ameobi was beating MK Dons left-back Dean Lewington with ease inside the opening five minutes before eventually matching one of his energetic bursts down the wing with the right cross into the box for Tony Watt, who could not quite meet an inviting lofted pass with a header on goal.
Kenwyne Jones was inches away from poking the visitors in front minutes later as he looked to get on the end of Scott Malone's left-wing cross, but Lewington's last-ditch lunge scooped the ball away.
It was Watt who went close himself in the 22nd minute after working his way around a number of defensive challenges inside the box. He then found himself in acres of space to fire a shot towards goal but he took one touch too many and ran the ball out of play.
Russell Slade's side wasted two more good chances just before the half hour as Anthony Pilkington ran through one-on-one with MK Dons goalkeeper David Martin who got down low to save before Malone had a drilled effort from inside the box well closed down.
Karl Robinson's side finally had an effort on goal five minutes before the break as Samir Carruthers saw his curling strike sail just over David Marshall's crossbar.
And despite having little in the way of attacking chances in the first half with no shots on target, it was Robinson's side who came out from the break on the front foot and took the lead through former Cardiff forward Maynard.
It was Carruthers who picked up the loose ball inside the visitors' defensive third before feeding the ball through to the feet of Maynard on the edge of the area and he drilled home his third goal of the season.
With nine minutes left, second-half substitute Noone fired the Bluebirds level with a looping strike from inside the Dons area that sailed over the arms of Martin and into the top corner.
But with time almost up, Murphy rode two challenges before bending home his fourth of the campaign to send the MK Dons faithful home happy.