Napoli were desperate to atone for a woeful end to 2012 that saw the Serie A challengers slip 10 points away from league leaders Juventus, courtesy of both consecutive defeats and disciplinary sanctions.
Zdenek Zeman's Roma are eager to keep pace with the chasing pack but identical goals from Cavani at the start of either half caught the Giallorossi unawares, with the Uruguay international soon making it eight goals from 11 appearances against the capital club to put the result within reach.
Substitute Pablo Osvaldo offered shellshocked Roma a glimmer of hope with a consummate finish in the 73rd minute, but Miralem Pjanic's dismissal left room for one last goal from Christian Maggio and Napoli duly returned to third place in the table.
Cavani could not have hoped for an easier opportunity to start his personal goal rush just four minutes into the game.
Goran Pandev picked the lock and the Uruguayan sauntered between Ivan Piris and Leandro Castan to tap the ball beyond an onrushing Mauro Goicoechea.
Cavani's next touch on a Pandev through-ball was awry, and Roma were soon threatening a response.
Morgan de Sanctis stood tall when Mattia Destro roamed into the box, the Napoli keeper sprawling against a treacherous effort from the young striker just moments later.
De Sanctis flicked a thunderous Miralem Pjanic drive out from under his crossbar and smothered a fierce strike from Erik Lamela as the Giallorossi pressed on.
The architect of all Napoli's early work appeared the most likely to double his side's lead before the break, but Pandev lost control at the by-line having burst through the back four.
There was an unwelcome sense of deja-vu among the travelling players as Goicoechea trudged into his goal to retrieve the ball just three minutes after the restart.
A quick break had followed Daniele De Rossi's attempt on the Napoli goal and Cavani was at the end of a flowing move to slot home his 15th league goal of the season.
Goal number three passed Napoli by in the 55th minute, though, as Marek Hamsik skipped past Goicoechea only to clatter the ball against the woodwork.
A furious Zeman gesticulated on the touchline as Hamsik danced through the box again, this time teeing up Cavani to smash the ball against a prostrate Piris.
Hugo Campagnaro knocked Destro off his balance and Zeman promptly withdrew his misfiring striker for Osvaldo.
But nothing could explain the mad minute that preceded Napoli's third, as Roma contrived to spurn three gilt-edged chances.
Lamela and Pjanic both failed to hit the target in front of a stranded De Sanctis, with Michael Bradley's inability to convert causing much hand-wringing among the travelling fans.
Cavani's hat-trick was complete in the 71st minute as the indomitable striker glanced home a header at the near post to prolong Roma's distress.
The game was not quite dead, though, and Osvaldo dragged his side back into the contest two minutes later with a classy finish from Pjanic's cross.
However, the Bosnian's role in any revival was cut short as he received a second yellow card and his marching orders for an overzealous challenge on Blerim Dzemaili.
Bradley's diving header was wayward and Roma's sloppy approach saw Cavani net once again, only for the offside flag to spare further embarrassment.
The Uruguayan was hungry for more and thumped the pitch in anger after losing his balance in front of Goicoechea, but Maggio would beat the offside trap to add the gloss to a momentous win with a cool finish in stoppage time.