The prolific Cavani started the scoreboard before four minutes, and though Pablo Osvaldo grabbed one back for Roma, they were never in control of their defence and Christian Maggio sealed the victory in stoppage-time.
A determined and at times desperate Roma were not prepared to go down without a fight, firing shots at goal including an Erik Lamela long-distance drive that went over the bar.
Napoli now have 37 points, overtaking Fiorentina and Internazionale, and are just seven points behind leaders Juventus.
Roma, meanwhile, stay sixth after losing two of their last three games.

