David McGoldrick volleyed in his first goal since August to put Ipswich ahead.
Revell, who recently saved a penalty as an emergency goalkeeper against Preston, levelled from the spot.
Brett Pitman's glancing header restored Ipswich's lead, and Revell poked home Josh Murphy's free-kick to equalise before Varney's header sealed victory.
Ipswich manager Mick McCarthy: "It was exciting for both sets of fans but frustrating for me.
"We have already started thinking about next season - that is an ongoing process."
MK Dons manager Karl Robinson: "It was disappointing for us but it summed up our whole season. We were good but also poor in certain key areas.
"It has been a massive learning curve. Some of these players deserve to be in the Championship but some don't and that is why we are where we are."

The 23-year-old midfielder has scored 21 goals in 53 league appearances since joining the Gunners from Sunderland Ladies in 2010.
Nobbs has won two league titles, three FA Cups and four Continental Cups during her time in north London.
She has won 24 international caps and helped England finish third at the World Cup in Canada last summer.
Arsenal Ladies have not disclosed the length of Nobbs' new deal.

Zaporizhya is typical of eastern Ukraine in that it was full of communist monuments and street names. But new laws say they must be removed because they symbolise the country's repressive past.
The campaign has triggered controversy, with critics saying that it is a crude assault on Ukraine's past.
BBC Monitoring reports and analyses news from TV, radio, web and print media around the world. For more reports from BBC Monitoring, click here. You can follow BBC Monitoring on Twitter and Facebook.

The UNHCR said forced returns had "continued unabated" despite an agreement earlier this month.
Under the deal, any returns would be voluntary and only "when conditions were conducive".
Cameroon has rejected the accusation and said people returned willingly.
According to the UNHCR, more than 2,600 refugees have been forcibly returned to Nigeria from Cameroon this year.
Many are unable to go back to their villages in Borno state for security reasons and have ended up in camps for displaced people.
In some cases, the UNHCR said, people had been returned "without allowing them time to collect their belongings".
UNHCR spokesman Babar Baloch spoke of "chaos" in the returns process and said "some women were forced to leave their young children behind in Cameroon, including a child less than three years old".
Many of the returnees are now settled in the Banki camp for internally displaced people.
UNHCR staff also recorded about 17 people who claimed to be Cameroonian nationals, who it said had been deported by mistake to Banki.
It is common in the region to find people who have no documentary proof of their nationality.
Cameroonian Communications Minister Issa Tchiroma told the BBC's Focus on Africa programme: "I strongly deny this accusation" of forced returns.
He said the Cameroonian army had been working "hand-in-hand" with the Nigerian army against Boko Haram and any civilians who had returned to Nigeria had done so of their own accord.
"This repatriation has taken place willingly," he said.
The Cameroonian authorities have previously said Boko Haram militants have been entering the country disguised as refugees.
Militants have carried out a number of attacks in northern Cameroon in recent years, often using suicide bombers.
The UNHCR said forced return constitutes a serious violation of the 1951 Refugee Convention and the 1969 OAU Convention, both of which Cameroon has ratified.
It called on Cameroon to honour its obligations under the conventions and continue keeping its borders open so as to allow access to territory and asylum procedures for people fleeing the Islamist insurgency.
Luke Varney's late winner secured Ipswich's first win in eight games, despite Alex Revell's brace for already-relegated MK Dons.
[NEXT_CONCEPT]
England international Jordan Nobbs has signed a new contract with FA Women's Super League 1 side Arsenal Ladies.
[NEXT_CONCEPT]
Ukraine has been trying to break free from its communist past, and the campaign is changing the face of whole cities.
[NEXT_CONCEPT]
The UN refugee agency has criticised Cameroon for the forced return of hundreds of refugees to north-east Nigeria after they had fled from the Islamist Boko Haram insurgency.