Juventus travelled to the San Siro looking to make amends after a goalless stalemate against the Europa League champions in Turin on Wednesday.
But the Bianconeri were left scratching their heads after Mauro Icardi levelled Stephan Lichsteiner's 66th minute opener only two minutes later, beating Gianluigi Buffon for the seventh time in their past eight meetings.
United stunned by Feyenoord, Inter beaten by Beer-Sheva
Allegri replaced misfiring striker Mario Mandzukic with Argentinian Gonzalo Higuain, but twelve minutes from time Icardi turned provider for Croatia star Ivan Perisic to head a superb winner past Buffon and secure a morale-boosting win for Inter's embattled Dutch coach Frank De Boer.
It was Juventus's first reverse of the season and the first time Inter had beaten the Biaconeri at home since the Jose Mourinho's treble-winning season in 2010.
Napoli sit top with a one-point lead on the champions and for the second time this week, Allegri was riled.
"This defeat will sting us, but it should also help us get our feet back on the ground," Allegri told Sky Sport.
The 49-year-old had warned after the Sevilla game that the "euphoria" surrounding Juventus's hopes of success at home and in Europe this season could easily turn to "disappointment".
Another shaky performance from the Serie A champions on Sunday left Allegri calling for improvements.
"It was quite a messy, tough game today. But once we got in front, we should have tried to defend our lead till the end. We need to be more clinical, and fight more if we are to win games," said Allegri.
Totti scores in 23rd consecutive Serie A season
Napoli, fresh from a come-from-behind win over Dinamo Kiev in their Champions League opener in midweek, go clear of the pack for the first time this season and once again they had Polish striker Arkaduisz Milik to thank.
After hitting a brace in midweek, the 22-year-old struck twice again in a 3-1 win over Bologna on Saturday.
Bought from Ajax as a replacement for Juve-bound Higuain, Milik has now hit six goals in five game and four goals in four league games.
Allegri, meanwhile, was quick to praise De Boer and it must have been welcomed by the Dutchman after a tough first month in the Inter hot seat after succeeding Roberto Mancini.
"Inter had a great game, that's why we ended up in difficulty," admitted Allegri.
"We didn't lose our head when we went a goal down, we started to fight. I think we deserved to win," said De Boer.
He said the key had been Inter's collective strength. "This result gives us confidence and we needed that as a team. It's important to move on as a team and today we did that. That's the only way we can get results."
Inter's hopes of finally challenging for a first title since 2010 could hinge on how they fare against inferior opposition -- they suffered a 2-0 defeat at Chievo on their opener and were then held 1-1 at home by Palermo.
Nice not taking a risk in signing me, says Balotelli
De Boer added: "We need to show this spirit in every game, against Empoli and Bologna too, otherwise all this will be for nothing."
AC Milan's precious 1-0 win at Sampdoria on Friday meant it was a happy weekend for fans in the Lombardy capital, but it wasn't for the Giallorossi fans of the capital.
Roma huffed and puffed their way to a 1-0 defeat to Fiorentina, who had Milan Badelj's late winner -- that caught Wojciech Szczesny out after going through Nikola Kalinic's legs -- to thank for a win that gave their bid a huge boost.
Paulo Sousa's men are now up to eighth at four points behind Napoli, although Fiorentina would possibly be second if their game last week at Genoa had not been rained off.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ