Central defender Manny Smith grabbed the winner four minutes from time, forcing the ball home from six yards from Steve Jones' cross.
The defeat means that MK Dons, who had slipped out of the race for the play-offs, ended the season with an 11-match winless run.
They took the lead in the 27th minute when, despite calls for offside, Daniel Powell was allowed to hook in after a shot from Jermaine Easter had been blocked by home keeper Rene Gilmartin.
Walsall were level a minute into the second half with Matt Richards driving the ball home from 20 yards following good work by Troy Deeney.
There was a demonstration by some of the home fans against club owner Jeff Bonser, who keeps a tight rein on spending, but the players maintained their concentration to go on and get the winner.