Sassuolo emerged worthy winners at the San Siro after recovering from Alessio Romagnoli's 21st-minute header through a superb Gianluca Scamacca strike, Simon Kjaer's own goal and a solo effort from Domenico Berardi.
"We carried on playing even though we went down a goal. We found faith in ourselves and that's a positive thing," said Sassuolo coach Alessio Dionisi to DAZN.
"We came back against Milan at the San Siro and we held on to the result... Today there were a lot of positives."
Milan, who finished with 10 men after Romagnoli completed a miserable afternoon by being shown a straight red card for taking out Gregoire Defrel, are level on 32 points with league leaders Napoli who host Lazio in Sunday's late match.
Fifa president Gianni Infantino was among those present in Naples as a statue of club legend Diego Maradona was unveiled ahead of kick-off to honour the one-year anniversary of his death.
Their first home league defeat of the season after last weekend's 4-3 loss at Fiorentina mean that city rivals Inter Milan are now only a point behind in third, with Atalanta a further three back after beating Juventus in Turin on Sunday.
"We were lacking lucidity because we made mistakes in far too many situations," said Milan coach Stefano Pioli.
"We needed to manage our lead better... we made a mistake for which we paid handsomely, and it's clear if you concede seven goals in two games something's not working."
Pioli, who on Friday signed an extension to his Milan contract until June 2023 with an option for another year, made a raft of changes to the side that earned a superb 1-0 Champions League win at Atletico Madrid on Wednesday.
Injuries to Olivier Giroud and Ante Rebic led to Zlatan Ibrahimovic playing up front with a strong support line of Rafael Leao, Brahim Diaz and Alexis Saelemaekers, with Tiemoue Bakayoko making his first start of the season in midfield alongside Ismael Bennacer.