Captain Alessio Romagnoli headed Milan ahead in the 21st minute but Sassuolo equalised just three minutes later when Gianluca Scamacca smashed in via the crossbar from 25 yards.
Simon Kjaer then turned into his own net before Domenico Berardi added the visitors’ third in the second half.
Romagnoli was shown a straight red for bringing down Gregoire Defrel late on.
Milan, who are now three games without a win in the Italian top flight, remain second, but leaders Napoli can build a three-point advantage by beating Lazio at 19:45 GMT.
Sassuolo’s success was their first in four games.