An enthralling Derby della Madonnina saw three penalties awarded as the Rossoneri's title challenge finally collapsed, sending the Scudetto to Turin
Milito fired the Nerazzurri into the lead after a quarter of an hour, but Milan responded through a controversial penalty from Zlatan Ibrahimovic three minutes before the break.
The Sweden international struck again barely a minute into the second half to put the Rossoneri back into the lead, but a pair of penalties from Milito swung the advantage Inter's way.
Maicon rounded off an emotional victory with a spectacular effort from distance with only minutes remaining, as Juventus' concurrent win over Cagliari put the title race beyond any doubt, mathematically assuring the Bianconeri of the championship with one game to spare.
Milan created the first chance of the match after 12 minutes, but it was wasted by Ibrahimovic, who fired over the bar from point-blank range following an inviting cross by Robinho.
His profligacy would be punished by Inter two minutes later when they took the lead, though they were aided by some less than stellar defending from Allegri’s side.
A free-kick from Wesley Sneijder was pumped into the area towards the head of Walter Samuel, who had all the time in the world to square to the unmarked Milito for a tap in.
Matters became more complicated for Milan, with the injured Daniele Bonera substituted for Mattia De Sciglio, as Inter continued to press forward following their opener.
Lucio saw a goal correctly disallowed for offside, but the referee was forced to work a bit harder just past half an hour, as a header by Esteban Cambiasso was clawed away by Christian Abiatti, barely an inch from crossing the goal line.
Abbiati made another fine save on Sneijder soon after, but he would not last for long, and was forced off through injury for Marco Amelia on 35 minutes.
The loss of their goalkeeper seemed to bring Milan out of their shell, and they began to exert more pressure on the Inter goal, with only the palms of Julio Cesar denying Ibrahimovic from close range.
Controversy would rear its head three minutes before half time, as Milan were awarded a penalty after a challenge by Julio Cesar on Boateng, even though the Inter keeper clearly appeared to make contact with the ball first.
The referee was not moved by Inter’s protests, though, and despite a bit of gamesmanship from Julio Cesar, Ibrahimovic was able to step up and score his 10th penalty of the season.
It got even better for the Rossoneri 40 seconds into the second half, as a superb touch at the edge of the box from Ibrahimovic saw him skip past Lucio and dink past Cesar to put Milan ahead for the first time.
Inter would not let them rest easy however. Sneijder almost surprised Amelia with a volley from long range, and when Ignazio Abate dragged down Milito in the area, the referee was left with little choice.
Milito took the spot-kick himself, and buried it confidently past Amelia to put Inter back on terms.
Milan should have soon been back in front, but somehow Sulley Muntari failed to turn home Ibrahimovic’s flick from in close.
Robinho fired into Cesar’s legs, and Mario Yepes headed wide as Allegri’s men looked to have the upper hand as the second half wore on.
However, they were pegged back in dramatic fashion with 10 minutes remaining, after a handball in the box by Alessandro Nesta was spotted. Milito steadied himself once more to fire home from 12 yards, and round off his personal treble - the first time a player had netted a hat-trick in the Derby della Madonnina since Jose Altafini scored four for Milan in 1960.
By this point, Juventus had opened up a two goal lead over Cagliari, meaning that Milan’s title hopes were disappearing fast.
There was to be no recovery for the Rosonneri, and Maicon sealed matters in the 87th minute with an ambitious strike from all of 30 yards that left Amelia rooted to the spot.
Milan square off against Novara in their last game of the season, while Inter face a crucial trip to the capital to face Lazio as the race for third place enters its final lap.