© Getty Images
Ben Reeves saw a free kick well kept out by the goalkeeper but MK Dons finally edged ahead when Will Grigg raced through on goal before clipping the ball over Conrad Logan for his seventh goal of the campaign.
However, a minute later, Rochdale stunned the home crowd with an equaliser courtesy of Flanagan diverting the ball into his own net from a Reuben Noble-Lazarus cross.
MK Dons were momentarily rattled as the visitors grew in confidence but 10 minutes before the break, a flowing move almost resulted in Baker driving a volley into the top corner after neat play from Reeves.
Like in the first half, MK Dons began sharply after the break and could have retaken the lead minutes after the restart when Reeves's shot clipped the underside of the crossbar before being cleared by the Rochdale defence.
Soon afterwards, Grigg was sent clear on goal but unlike earlier in the game, Logan was equal to it before Antony Kay failed to get enough power on his header when well placed.
The hosts continued to come up short in the final third and with 14 minutes remaining, Rochdale went in front when Noble-Lazarus let fly from 25 yards to net his second goal of his loan spell from Barnsley.
It was a strike that deserved to win any game but it wouldn't on this occasion as MK Dons found a response. After initially setting up Benik Afobe, Green reacted quickest after the striker's shot was saved to slot home the rebound.