Gianluca Lapadula put the visitors in front against the run of play after half an hour, but Napoli pulled level early in the second half through Arkadiusz Milik.
Gennaro Gattuso’s side were left stunned when Lapadula struck again with a header before Marco Mancosu whipped a stunning free kick into the top corner, and Jose Callejon’s 90th-minute bicycle kick was too little too late.
The result ended a run of three consecutive wins for Napoli in all competitions and left the hosts in 11th place with 30 points, eight ahead of 17th-placed Lecce.
Elsewhere, Diego Lopez was denied a win on his debut as Brescia coach after a stoppage-time equaliser from Udinese’s Rodrigo De Paul cancelled out Dimitri Bisoli’s opener to earn the visitors a 1-1 draw.
Genoa secured only their fourth win of the season with a 1-0 victory against Cagliari, Goran Pandev’s first-half strike stretching the visitors’ winless league run to nine matches.
Sassuolo came from behind to beat bottom side SPAL 2-1, a Francesco Caputo penalty and last-minute Jeremie Boga header responding to Kevin Bonifazi’s first-half opener for SPAL.