Simone Pepe scored his first Serie A goal in the 90th minute on Saturday as Cagliari beat Italian league co-leader Palermo 1-0.
Palermo played with 10 men for the entire second half after Fabio Simplicio was sent off for a last-man foul on Cagliari striker David Suazo just before halftime.
Despite the disadvantage, Palermo did well to contain Cagliari until Pepe scored the winner from the edge of the box.
Palermo and Inter Milan both had 27 points before Inter's match against last-place Reggina yesterday.
Palermo and Inter meet next weekend.
"We have to stay calm and prepare the best we can for Inter," Palermo coach Francesco Guidolin said. "We've also got the UEFA Cup midweek. We're under pressure, but there's no tension."
Earlier, AC Milan ended a three-game losing streak by drawing 0-0 at Empoli.
Brazilian striker Ricardo Oliveira hit the crossbar in the 17th minute and the post in the 45th, but that was as close as Milan came to scoring.
Milan is now 4-4-4 with eight points for 14th place. The Rossoneri began the season with an eight-point penalty from the Italian match-fixing scandal.
Empoli moved into a tie with three other clubs for fourth place with 16 points.
Milan coach Carlo Ancelotti replaced striker Alberto Gilardino with Filippo Inzaghi in the 59th, but Milan still struggled. Goalkeeper Dida saved a long shot by Empoli midfielder Antonio Busce in the 66th.
"We played an attentive game," Ancelotti said. "On the important plays we continue to be unlucky, but the team played pretty well today. We didn't allow Empoli anything and we had our chances. This was a step forward."