The hosts raced into an early lead after skipper Alessio Romagnoli headed home from a corner in the 21st minute, and Milan looked on course to get back to winning ways in the league following last weekend's loss at Fiorentina.
However, Sassuolo, who beat Juventus away from home last month, turned the match on its head, with Gianluca Scamacca's stunning strike and Simon Kjaer's unfortunate own goal giving them a 2-1 lead inside 33 minutes.
Even with veteran striker Zlatan Ibrahimovic leading the line, Milan struggled to issue a response, as Domenico Berardi made sure of a thoroughly deserved victory for Sassuolo with a superb solo goal in the 66th minute.
Romagnoli's red card in the 77th minute effectively ended Milan's hopes of getting anything from the match. They remain second in the standings, level on 32 points with leaders Napoli, who play Lazio later on Sunday.
Sassuolo's first win in four league games sees them climb to 12th on 18 points.
"We lacked a cutting edge," Milan coach Stefano Pioli told DAZN. "We got too much wrong in key situations, especially in the opposing area.
"We missed the last pass or the attack on the goal. We had to manage the one-goal advantage better and instead we made a mistake that proved costly.
"It is clear that if we have now conceded seven goals in two [league] games, something did not work."
Milan came into the contest on the back of the defeat in Florence last weekend -- their first of the season in Serie A.
But, having earned a crucial Champions League victory in midweek over Atletico Madrid, they looked in better form as Romagnoli's first goal of the season gave them a deserved lead.
Then Scamacca's bolt from the blue, an arrowing strike from 25 metres that flew into the top corner in the 24th minute, stunned the hosts, who were behind before they knew it.
Scamacca had a big hand in the visitors' second goal, too, as it was his drilled attempt that was saved by returning Milan goalkeeper Mike Maignan, but the ball came back off Kjaer and into his own net.
After the break, Ibrahimovic unleashed a fierce strike from distance that fizzed just wide, but otherwise Sassuolo were containing their opponents with ease.
The goal that sealed the victory was clinical in its execution, as Italy forward Berardi twisted and turned before drilling past Maignan to spark wild scenes of celebration.