Antonio Cassano opened the scoring 26 minutes into his first match after having heart surgery in October in a health issue which threatened to prevent him turning out for Italy at Euro 2012.
He now looks poised to be the Azzurri's talisman in Poland and Ukraine while Milan can only wonder what might have been.
"It is such a shame we've not had Cassano for all of the season," Milan chief executive Adriano Galliani said.
A Zlatan Ibrahimovic double, with his second coming deep into injury time, and a late Antonio Nocerino goal completed the victory.
"It was important to win today so we could stay close to Juventus. Now we have to hope they drop some points in these final three games, while we'd have to win them all," said Milan coach Massimiliano Allegri.
Inter Milan and Udinese moved level on 55 points with third-placed Napoli, who drew 2-2 with Roma on Saturday night, and Lazio in the pursuit of the final Champions League spot after they both enjoyed important home wins. They still trail Milan by 19 points though.
Inter came from behind to beat already-relegated Cesena 2-1 thanks to goals from Joel Obi and Mauro Zarate.
Second-half strikes from Antonio Di Natale and Roberto Pereyra gave Udinese a valuable win in a drab encounter against a tired-looking Lazio, which ended in chaotic scenes.
Lazio keeper Federico Marchetti went up for a corner, and after nearly scoring, Lazio stopped as they thought that they had heard the final whistle.
However, that whistle had come from the crowd and when Pereyra slotted into the empty net Lazio's players were enraged, with scuffles breaking out on the pitch and the sideline.
Andre Dias, who was particularly aggressive in his protests, was sent off and Lionel Scaloni was booked as things threatened to spiral out of control, before referee Mauro Bergonzi eventually blew for the end of the game.
Inter looked to have no chance of reaching third just a month ago but rookie coach Andrea Stramaccioni is boosting his chances of getting the job permanently as he eases some of the fans' pain over their two great rivals bossing the title race.
Juventus won at Novara thanks to a brace from Mirko Vucinic - the first a delightful flick from a Andrea Pirlo free kick - and goals from Marco Borriello and Arturo Vidal.
Juve, who host third-bottom Lecce on Wednesday, are unbeaten in Serie A with three games left and are on course for their first scudetto since a 2006 match-fixing demotion.
Inter had a scare at the San Siro when Luca Ceccarelli's effort from distance went in on 56 minutes but Obi replied two minutes later and on-loan Zarate saved Inter's blushes with 18 minutes left.
"Will I stay? It depends, my 12 agents have to negotiate my salary," joked Inter coach Stramaccioni, who replaced Claudio Ranieri last month after impressing with the youth team.
At the other end of the table, fourth-bottom Genoa lost 3-2 at Bologna to further anger their "ultra" fans who rioted in their home defeat by Siena last weekend.