Napoli, who went into the game four points adrift of leaders Roma following their defeat to Juventus prior to the international break, dictated play for most of the encounter.
Striker Gonzalo Higuain and winger Lorenzo Insigne both went close in the first half for the hosts, but goalkeeper Pepe Reina had to be at his best to keep out an effort from midfielder Marco Parolo.
Rafael Benitez's men's dominance waned in the second half, however, and they were punished nine minutes from time when former Milan and Inter striker Cassano struck.
Cassano made no mistake as he slotted home the winner after being released on the counter-attack by substitute Afriyie Acquah.
Milan's winless run was extended to seven games as they were held to a 1-1 draw by 10-man Genoa at San Siro.
And they looked to be on their way to a much-needed triumph when attacking midfielder Kaka powered a composed finish beyond Mattia Perin after latching on to a ball over the top from Nigel de Jong after just four minutes.
However, that lead lasted only five minutes as Alberto Gilardino converted from the spot following Urby Emanuelson's foul on Sime Vrsaljko.
Milan were offered a huge lifeline when Genoa defender Thomas Manfredini was dismissed nine minutes before half-time after conceding a penalty for bringing down Mario Balotelli.
Balotelli's spot-kick was saved by Perin, though, and despite numerous chances in the second half, Milan were unable to make their numerical advantage count.
Elsewhere, Slovenian midfielder Dejan Lazarevic scored in injury time as Chievo handed Verona their second straight defeat.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.