With league leaders AC Milan not in action until later on Sunday, victory in Naples would have sent Napoli top, as they go in search of their first Scudetto since 1990.
But they were chasing the game after Nicolas Gonzalez hammered the visitors into a 29th-minute lead.
Dries Mertens dragged the hosts level eight minutes into the second half, but Jonathan Ikone's fine drilled finish and a superb solo goal from Arthur Cabral stunned the Diego Armando Maradona Stadium into silence.
Napoli's top goalscorer Victor Osimhen got one back six minutes from time, but it was too little too late, as Spalletti's side remained in third, one point behind Milan ahead of the leaders' trip to Torino. Fiorentina climbed to seventh.