Goals from Robinho and Mario Balotelli had given AC Milan a 2-0 lead just 13 minutes into the match before Berardi stole the show at the Citta del Tricolore stadium.
The 19-year-old forward, who is on loan from Juventus, scored a hat-trick before the break and added his fourth two minutes into the second half.
Substitute Riccardo Montolivo gave Milan a lifeline four minutes from time but Sassuolo held on for their biggest win in their maiden campaign in Italy's top flight.
The loss was Milan's seventh of the campaign and dropped the Rossoneri to 11th place, 30 points behind Serie A leaders Juventus at the halfway stage.
Earlier in the day, Juve came from behind at Cagliari to claim their 11th consecutive league triumph.
Mauricio Pinilla put Cagliari ahead in the 21st minute before Fernando Llorente equalised on the half-hour mark.
Claudio Marchisio gave Juve their first lead in the 73rd minute before Spanish international Llorente scored his second three minutes later.
Stephan Lichtsteiner notched the Turin club's fourth goal in the 80th minute.
Juve are eight points clear of Roma at the top of the standings.
Manchester United coach David Moyes was in the stands at the Sant' Elia stadium to reportedly monitor Cagliari defender Davide Astori.
Roma, coming off their first loss in Serie A - a 3-0 defeat at Juve - romped to a 4-0 triumph over Genoa.
Goals from Alessandro Florenzi, Francesco Totti and Maicon handed Roma a 3-0 half-time lead. Mehdi Benatia wrapped up all three points for the Romans in the 52nd minute.
Genoa finished the game with 10 men after Francesco Matuzalem was shown a red card on the hour mark.
Dries Mertens was again on target as Napoli won 3-0 at Hellas Verona.
The Belgian winger, who struck twice against Sampdoria last weekend, put the Naples outfit on its way in the 27th minute.
Napoli put the game beyond Hellas' reach with Lorenzo Insigne and Blerim Dzemaili getting on the scoresheet midway through the second half.
Fiorentina lost ground on Napoli and the last Champions League qualifying spot as they were held to a goalless draw at Torino.
The absence of injured Giuseppe Rossi hurt Fiorentina, who failed to threaten the home side in the day's early kick-off.
Rossi, Serie A's top scorer with 14 goals, is out of action with a right knee injury.
The outcome dropped the Viola five points behind Napoli.
Atalanta claimed all three points for the first time in two months with a 2-1 triumph over Catania.
The outcome lifted the Bergamaschi to 12th place and kept bottom-side Catania winless on the road this season.