Hamsik strike sends Napoli second
Manager Nigel Clough hopes Derby can maintain their strong home form against Championship leaders Cardiff on Tuesday night.
The Rams have won their last three matches at Pride Park, scoring nine goals along the way.
Eighteen of their 26 points have been won at home, with Burnley the only side to defeat Derby on their home turf in the league this season.
Ahead of Cardiff's visit on Tuesday night, Clough said: "We have played well in the majority of our games at home and we are looking to keep our home form going.
"The setback against Burnley did not affect us too much because we played so well on the day and didn't deserve to lose, and in the end it was a last-minute goal and there was very little time to respond.
"We had another good home win on Saturday [3-2 against Birmingham] and Cardiff will provide us with another stern test, I'm sure."
Walter Mazzarri's side struggled to impress and, after hitting the post early on, the Partenopei spent most of the time defending.
Cagliari hit the woodwork twice and looked more likely to score until Hamsik pounced on a loose ball to earn the visitors all three points and take them above Inter Milan and Fiorentina.
Lorenzo Insigne rattled the post at the end of a rare Napoli attack in the 21st minute, but Cagliari were largely the livelier of the two teams in the first half.
A good cross-field ball to Thiago Ribeiro set him up for a good chance in the 31st minute, but he could not keep up with the pace and his shot was weak and off target.
At the other end, Blerim Dzemaili picked out Insigne with a long, searching ball and he cut back inside a defender but shot wide of the near post.
Alessandro Gamberini almost gave Napoli the lead when he diverted a corner against his own post, before Danilo Avelar tried a speculative lob from 35 yards which landed on the roof of the net after De Sanctis had left his goal vacant.
Cagliari started the second half brightly with Radja Nainggolan cutting in from the left, but his shot was straight at De Sanctis from a tight angle
Paolo Cannavaro was the next Napoli player to almost put through his own goal in the 48th minute with the ball hitting the top of the crossbar before Nainggolan volleyed wide.
A goalmouth scramble saw Michael Agazzi called into action twice on the hour mark before Hamsik put Napoli ahead with a rare attack in the 72nd minute.
Juan Zuniga put pressure on Albin Ekdal, who nudged the ball inadvertently to Hamsik to curl into the far corner from eight yards.
It was harsh on Cagliari, who tried to find an equaliser, but the Rossoblu were unable to find one.