Cavani was rested by Napoli coach Walter Mazzarri ahead of the Champions League clash with Chelsea next week, but the home side were still able to score six goals without him.
Marek Hamsik, Paolo Cannavaro, Christian Maggio, Walter Gargano and Ezequiel Lavezzi shared their goals with Cagliari defender Davide Astori contributing with an own goal.
Joaquin Larrivey scored a hat-trick for some personal glory as the Sardinians went down 6-3.
The game was practically all over within half an hour as Napoli opened up a three-goal lead.
Hamsik put them in front in the 10th minute with a fine individual goal, advancing unchallenged and taking advantage of a slip by Daniele Conti before finding the bottom corner from nearly 25 yards out.
Cannavaro added the second in the 19th minute with a header which went in off the crossbar as he met Lavezzi's free-kick.
An own goal from Astori on the half hour mark gave Napoli a three-goal lead as he diverted Lavezzi's cross past his own goalkeeper and inside the near post.
Larrivey scored Cagliari's first goal in the 37th minute when he headed low past Morgan de Sanctis.
Lavezzi re-established Napoli's three-goal advantage with a penalty in the 55th minute after he was fouled by Michele Canini.
Cavani set up Gargano to beat Agazzi with a fine shot inside the far post after an excellent first touch to lift the ball past two Cagliari defenders in the 70th minute.
Larrivey responded with a header in off the base of the post in the 77th minute, but Maggio scored Napoli's sixth in the 84th minute when he beat Agazzi with an accomplished finish.
Larrivey then had the last word with another header to complete his hat-trick with the last touch of a dramatic game.