Gonzalo Higuain put Napoli on their way to victory in the ninth minute, but Esteban Cambiasso levelled.
Dries Mertens restored Napoli's advantage and Blerim Dzemaili gave them a two-goal cushion, which was halved by Yuto Nagatomo on the stroke of half-time.
Ricky Alvarez was sent off with 20 minutes remaining and a Jose Callejon strike 10 minutes from time sealed victory for Napoli with Rafael Benitez getting one over his former club. In the process, the Neapolitans responded to Fiorentina's 3-0 win over Bologna and repoened the gap to five points between the two clubs.
It soon became clear that it was going to be a spectacular evening in Naples when Rodrigo Palacio headed over from six yards out from a long ball forward in the sixth minute.
Just three minutes later, Higuain put Napoli ahead with a volley from 15 yards out, taking his first chance of the evening for his eighth goal of the season.
Mertens could have added a second within minutes, but his weak shot did not test Handanovic, who was nevertheless in for a far busier and more testing night as Napoli laid siege to his goal inside the first half an hour.
Lorenzo Insigne beat him in the 25th minute, but the crossbar kept the lively Napoli forward's shot out.
Ten minutes later, Cambiasso levelled thanks to fine work from reported Chelsea target Fredy Guarin, whose cross was dummied by Rodrigo Palacio to the Argentine, who swept the ball past Rafael.
Napoli restored their advantage just four minutes later when Higuain sent Dzemaili through. He did not have the pace to race through on goal, but as he turned back inside, Mertens appeared on the scene, taking the ball off his toes with a 20-yard shot which caught everybody, not least Handanovic, by surprise.
Dzemaili then got his own name on the scoresheet to make it 3-1 when Handanovic pushed Mertens' shot out to give him an easy finish.
Inter were given hope on the stroke of half-time when Guarin's low shot to the far post was tucked in by the unmarked Nagatomo.
The Nerazzurri nearly levelled in the 66th minute when Palacio's cross invited Guarin in front of Rafael, who made a brave save at his feet just eight yards out.
Five minutes later, Alvarez was shown a second yellow card, reducing Inter to 10 men and leaving them a mountain to climb.
That mountain became insurmountable when Insigne's low cross was turned in by Callejon at the far post, and substitute Pandev should have made it five in stoppage time, but his penalty was turned behind by Handanovic.