Cassano headed home on 82 minutes against his former club after a frustrated Milan had gone behind at the San Siro to a Gergely Rudolf goal in the first half and then had striker Zlatan Ibrahimovic sent off with 17 minutes to play.
With nine matches of the season to go, the result means Milan remain five points clear of rivals Inter, who drew with Brescia 1-1 on Friday, and six above Napoli, who got back to winning ways with a 3-1 victory at Parma.
A potentially decisive Milan derby is on April 3.
"There is some bitterness as we deserved more this week but we have to look on the bright side - we didn't lose even with ten men," Milan coach Massimiliano Allegri said before offering a word of sympathy for the out-of-sorts Ibrahimovic.
"Unfortunately he reacted but these things happen," Allegri said. "He shouldn't allow the fact that he hasn't scored for a month bother him."
In Rome, a late double from skipper Totti gave Roma a 2-0 victory over Lazio for their fifth successive derby win, offering the Giallorossi tifosi some relief after their midweek Champions League exit to Shakhtar Donetsk.
After Roma's David Pizarro had struck the bar for Roma early on and Stefano Floccari missed a close-range header for Lazio on 66 minutes, Totti lit up the Stadio Olimpico on 69 minutes, lashing a touched free-kick through the wall and past goalkeeper Fernando Muslera.
Stefan Radu and Cristian Ledesma were sent off as tempers flared in the final minutes before Totti provided the finishing touch, converting a penalty to take sixth-placed Roma two points behind Lazio, who slip to fifth.
"Winning against Lazio always brings a good feeling," Totti said after a record 28th appearance in the fixture. "Scoring as a Roman and a true Roma supporter just makes it that more special."
In Sunday's late game, Napoli's poor form looked set to continue as Parma went ahead through a sweet Raffaele Palladino volley, but a different second half brought goals for Marek Hamsik, Ezequiel Lavezzi, back after serving a three-match ban for spitting, and Christian Maggio.
Parma, who had Daniele Galloppa sent off midway through the second half, slip to fourth from bottom with coach Pasquale Marino's position under renewed threat.
In Sardinia, Udinese, who hit Palermo for seven in Sicily two weeks ago, kept up their amazing scoring record away from home to defeat Cagliari 4-0 and go fourth in Serie A. Medhi Benatia, Alexis Sanchez and a brace by Antonio Di Natale, his 23rd and 24th this season, scored the goals in a 10-minute spell either side of half-time.
Francesco Guidolin's side, who have now scored 32 goals in 15 matches on the road, were applauded off the field by the Cagliari fans.
"It's such a rare but refreshing show of sportsmanship," the Udinese coach said. "They continued to sing and applaud their own team even when four down
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.