MILAN, Italy -- AC Milan and Napoli played out an entertaining 1-1 draw at San Siro in a battle for an automatic Champions League spot on Sunday.
It was a mixed night for Mathieu Flamini, who fired Milan into the lead in the 30th minute but was sent off 18 minutes from time.
Milan's lead lasted just three minutes before Goran Pandev took advantage of poor defending to level.
Second-place Napoli remains four points ahead of Milan, with six rounds still to play.
It is eight points behind Juventus, which plays Lazio on Monday.
"We haven't achieved our target of Champions League qualification yet, so we mustn't let anything go," Napoli coach Walter Mazzarri said. "I am not happy with the result, as we pegged Milan back in its own half and I hoped to win this game, we deserved the victory.
"Towards the end, especially when we had a numerical advantage, I hoped to win but we weren't clinical enough. We always allow our opponents more chances than we should."
Milan is four points above Fiorentina in the race for the Champions League playoff spot.
"Napoli is a side capable of defending second place but this is an important point for us, because we maintain a certain distance from Fiorentina," Milan coach Massimiliano Allegri said. "I cannot ask for more from my lads, because we played very well even after going down to 10 men.
"Football is unpredictable, so we will look over our shoulders, but also in front to Napoli."
Inter Milan's slim hopes of snatching a Champions League spot are all but over after it lost 2-0 to Cagliari. It has been leapfrogged by Roma, which beat Torino 2-1.
Milan striker Stephan El Shaarawy was surprisingly benched in favour of Robinho.
"Nobody can play an entire season at the top level," Allegri said. "In the last few rounds he had dipped in psychological terms, he is only 20 years old and has already scored many goals, which is precisely why he needs to be dealt with in the best way possible."
The home side was also without Mario Balotelli who was serving the first of a three-match suspension for insulting an official.
There was a brief flare up of trouble before the match as Milan fans threw stones at a bus carrying Napoli supporters and police had to intervene with tear gas.
Milan almost got off to the perfect start but Napoli goalkeeper Morgan De Sanctis palmed away Kevin-Prince Boateng's deflected effort.
Allegri's team broke the deadlock on the half hour mark. Boateng and Robinho combined well and the ball came out to Flamini, who sent a low drive into the bottom right corner.
But shortly afterwards a splendid cross from Marek Hamsik found Pandev, who got between two Milan defenders to fire in the equalizer.
Napoli could have taken the lead three minutes from halftime as Edinson Cavani beat the offside trap to race onto a long ball. He tried to lob Christian Abbiati but the Milan goalkeeper managed to fingertip it away from his goal.
Milan's chances of snatching all three points grew slimmer when Flamini was shown a straight red card for a horrendous tackle on Juan Camilo Zuniga. El Shaarawy replaced Robinho almost immediately afterwards but had little impact.
Napoli came close to winning the game in stoppage time as first Abbiati pulled off a great save to parry Pablo Amero's cross past Cavani. The ball was put then back into the area but susbitute Emanuele Calaio's header flew just wide.
Inter is nine points behind Milan after it lost in Trieste, where Cagliari is playing after abandoning its troubled Is Arenas stadium.
Cagliari took the lead in the 63rd minute after it was awarded a dubious penalty when Matias Silvestre was adjudged to have fouled Mauricio Pinilla. The striker converted and doubled his tally 13 minutes later following a one-two with Matias Cabrera.
Inter's fourth loss in five games leaves it a point behind Roma.
Pablo Daniel Osvaldo headed the capital side in front from a tight angle in the 22nd minute.
However, Torino levelled when Rolando Bianchi beat Nicolas Burdissimo to Alessio Cerci's cross and fired in from close range.
Erik Lamela scored what was to prove the winner when he curled a stunning strike into the top left corner from just outside the area.
Roma was forced to play the final 10 minutes with 10 men after Federico Balzaretti was sent off following a second booking.
At the other end of the table, relegation-threatened Palermo was forced to settle for a 1-1 draw at home with Bologna after a goalkeeping error.
Two straight wins had given Palermo hope of escaping the drop, and it made the perfect start when Josip Ilicic fired into the net following a one-two with Fabrizio Miccoli.
However, Bologna levelled following a moment of madness from Palermo goalkeeper Stefano Sorrentino.
Sorrentino went to collect Michel Morganella's backpass but appeared to only then remember he could not touch it with his hands. The ball rolled under his body, allowing Manolo Gabbiadini to round him and slot into an empty net.
The Sicilian side is two points from safety, level with Genoa which drew a derby match 1-1 against 10-man Sampdoria.
Eder gave Sampdoria the lead with an inventive free kick, drilling his effort below the wall as it jumped and into the bottom left corner.
The match changed 12 minutes from time when Andrea Costa received a second booking for a tackle on Antonio Floro Flores and was dismissed.
Mantuzalem levelled just two minutes later with a stunning strike that flew into the top left corner.
Elsewhere, Udinese cruised to a 3-0 victory at Parma while Chievo Verona drew 0-0 at home to Catania.