Arkadiusz Milik put the visitors ahead after two minutes with Dries Mertens, Simone Verdi and Amin Younes adding three more in the second half to inflict another blow on the hosts’ Champions League ambitions next season.
Juventus continued their march towards an eighth consecutive Serie A title with on-form teenager Moise Kean scoring the only goal against Empoli on Saturday.
Napoli have almost no chance of winning the title with nine games to go, but extended their cushion on third-placed Inter Milan to ten points before Luciano Spalletti’s side host Lazio later on Sunday.
“I expected a performance like this. In training I had seen the right spirit, the team is growing,” said Carlo Ancelotti, whose side are building towards a Europa League quarter-final clash against Arsenal.
“We were masters of the pitch.”
It was a further blow for Ranieri in just his third game since taking over from Eusebio Di Franecesco as the Romans fell to their second consecutive defeat for the first time this season.
“We’re going through a period where we concede from the first attack,” said former Leicester boss Ranieri.
“Do I regret having accepted Roma? Never. I could never regret training this club,” he added.
“It was tough, as Napoli swarm around you, change position constantly and make it very difficult to defend.
“We’re doing everything we can, but we’re not giving up.”
Roma’s hopes of qualifying for the Champions League are dwindling and they are in danger of missing out on European football as their sixth position is under threat from Lazio who are two points behind but have a game in hand.
Roma failed to take advantage of fourth-placed AC Milan’s 1-0 defeat against Sampdoria on Saturday. A win would have moved them within a point of the Champions League places.
Instead, Atalanta jumped to fifth with a 3-1 comeback win against Parma.
– Ancelotti at home –
Ancelotti’s Napoli dominated against the club where he spent eight seasons as a player. Roma were struggling to keep up from the start when Verdi sent the ball over for Milik to blast the visitors ahead early.
The Polish striker had a second goal disallowed for offside before Diego Perotti pulled Roma level just before the break with a penalty after a foul on Patrik Schick.
But hopes of a revival were short lived with Mertens tapping in a second four minutes after the break off a Jose Callejon assist.
Verdi piled more pressure on Ranieri’s side with a third on 54 minutes following good work by Fabian Ruiz on the counter attack.
Roma had chances with Napoli goalkeeper Alex Meret denying Bryan Cristante with Steven Nzonzi heading the rebound onto the bar.
But Younes compounded the misery of the hosts, adding the fourth nine minutes from time following a scramble on front of goal after a poorly cleared corner.
“It’s a bit of everything: the physical level, the mental level and the injuries,” added Ranieri.
“Technically the team has quality, it’s just that when it suffers defeats it’s unable to pick itself up.”
Colombian striker Duvan Zapata scored a late brace in a 3-1 comeback win for Atalanta who are three points off the Champions League places.
Zapata, 27, has scored 19 league goals this season, matching Juventus star Cristiano Ronaldo’s haul and two behind Sampdoria’s Fabio Quagliarella.
Torino held Fiorentina 1-1 in Tuscany and are two points adrift of the Europa League places.
Bologna moved out of the relegation zone with their third consecutive win, and sixth this season, 2-1 over Sassuolo.
Download our app and read this and other great stories on the move. Available for Android and iOS.