Goran Pandev struck twice for the hosts but Pepe popped up with the goal that salvaged a point after a barnstorming run as Juve piled on the pressure to stretch their lead over AC Milan to two points after 12 games with Napoli up to sixth on 17.
Marek Hamsik, having missed an early penalty, headed the home side in front midway through the first half before Pandev doubled their lead just before the break.
Alessandro Matri pulled a goal back for Juve just after the interval but Pandev struck again to put Napoli 3-1 ahead.
The visitors then staged a fightback with Marcelo Estigarribia poking the ball home after 73 minutes before Simone Pepe completed the comeback 11 minutes from time.
Bianconeri boss Antonio Conte praised his side's "inner strength" when they were behind.
"Without heart, you don't come back in games like these," he told Italy's Sky Sport channel. "We were a bit soft in the first half but the boys showed they wanted it tonight."
Napoli coach Walter Mazzarri, whose side remain nine points behind Juve, complained that his team could not last the pace after their exertions in the Champions League.
"I view the glass as half empty not half full with this result," he told Sky Sport.
"It was a spectacular first half but we collapsed after the break because we're playing twice a week and just didn't have the energy that they had to pressurise at the end."
Juventus, without the suspended Claudio Marchisio from the side that won 1-0 at Lazio on Saturday, started well with Mirko Vucinic finding space inside the penalaty area before pulling his shot wide after seven minutes.
But it was the home side, backed by loud support from another full house in the capital of Italy's south, who were gifted the chance to break the deadlock seven minutes later when Andrea Pirlo brought down Ezequiel Lavezzi inside the box.
Hamsik fired the perfect penalty into the corner but after wild celebrations he was ordered to retake it after encroachment and the Slovakian blasted his second kick over the bar.
The controversial moment appeared to fire Napoli up and they took the lead after 22 minutes when Lavezzi's free-kick fell to Hamsik on the edge of the six-yard box and the midfielder made no mistake with a diving header.
Pandev, starting in place of the injured Edinson Cavani, had two fine chances to double the lead in as many minutes.
Juve keeper Gianluigi Buffon had to be at full stretch to save the Macedonian's low skidding shot from the edge of the box after 26 minutes before the striker shanked his near-post effort wide after superb approach play from Lavezzi.
Five minutes before half-time the dangerous Pandev got his reward, latching onto a another ricochet inside the area before applying a low finish across Buffon's to put Napoli 2-0 ahead.
Juventus were handed a lifeline three minutes into the second period when Chilean midfielder Arturo Vidal was allowed acres of space to pick out Matri inside the box and the in-form Italy striker calmly slotted home.
But Napoli restored their two-goal lead after 68 minutes when Pandev controlled Christian Maggio's difficult cross before swivelling to brilliantly volley the ball in off the post.
Five minutes later, though, Maggio went missing in defence allowing Estigarribia plenty of time to control Matri's cross and poke the ball under the diving Morgan De Sanctis for the Paraguayan's first goal in Italian football.
With the bit between their teeth, the Bianconeri poured forward and Pepe took advantage of a lucky break after a powerful run to sidefoot
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.