Wins for Atalanta, Roma and Lazio earlier in the weekend had shunted Milan down to seventh ahead of the clash with Rolando Maran's side at San Siro.
But a freak own goal from defender Luca Ceppitelli gave Milan an early lead and its advantage was swiftly doubled by Brazilian attacker Paqueta.
Piatek wrapped up the scoring after the break with his fourth Milan goal and Gianluigi Donnarumma marked his 150th Rossoneri appearance with some fine saves in a well-earned clean sheet that keeps his side's Champions League qualification hopes on track.
Milan had only won one of its past four home league games but it made a strong start, Alessio Cragno making a smart stop to keep out Hakan Calhanoglu's powerful strike.
Cragno was beaten in the 13th minute when his save from a Suso's shot deflected back into his own net off the arm of unfortunate Cagliari captain Ceppitelli.
Milan made it 2-0 in the 22nd minute as Paqueta scored his first goal for the club, arriving at the back post to send a controlled volley past Cragno from Davide Calabria's right-wing cross.
Donnarumma saved well from Joao Pedro before the break and the same combination resulted in a key moment on the hour.
Milan's goalkeeper parried Joao Pedro's effort and on the rebound the Cagliari striker hit the crossbar with a chip when he had to score.
That miss was soon punished as Piatek hit his 15th Serie A goal of the season, the in-form forward pouncing on the loose ball after Cragno rushed off his line to block Calhanoglu's shot.