The Uruguayan striker was his typically clinical self in front of goal with poacher's efforts in each half sandwiching a spot-kick.
It took Cavani's tally for the campaign 33 and with it increased the advantage over AC Milan to seven points.
Ricky Alvarez had equalised for Inter after 33 minutes, but the visiting defence could not handle Cavani and Andrea Stramaccioni's side are five points off a European place with three matches remaining.
Inter could not have made a worse start as Napoli struck after just three minutes.
Gordan Pandev's well-worked ball found Cavani, who from 12 yards planted the ball past the onrushing Samir Handanovic.
Two minutes later Inter almost levelled as Fredy Guarin's powerful free-kick was well kept out by Morgan De Sanctis and Juan fired over from the resulting rebound.
Blerim Dzemail's shot fell inches wide of the post before Christian Maggio's header was easily saved by Handanovic.
De Sanctis was called into action again after 16 minutes to block Alvaro Pereira's drive, before he tipped a Gaurin effort round the post and out for a corner.
However there was little he could do to keep out the equaliser after 22 minutes.
Camilo Zuniga's clumsy challenge gave the referee little option but to award the spot-kick, with Alvarez's well-taken effort giving De Sanctis little chance.
Inter were not level for long, however, and after 32 minutes Zuniga was brought down by Moreira Jonathan and Cavani converted from the spot for his 100th Napoli goal.
Handanovic had to be alert to keep out Pandev's shot early in the second period, while Andrea Ranocchia headed wide after 52 minutes.
Alvarez was again denied by De Sanctis after 57 minutes before Cavani gave his side a two-goal cushion as he converted Pandev's cross from close range.