Juve coach Ciro Ferrara had presided over four defeats in five games but looks safe in his job for now after a victory sealed by two second-half goals from the little-used Alessandro Del Piero, the second a penalty.
The first goal was the main talking point, however, with Brazilian playmaker Diego, a major flop since his big close-season move from Werder Bremen, netted on 24 minutes despite Napoli's Jesus Datolo lying injured on the floor.
The in-form visitors furiously protested but the strike stood.
Juve face a quarter-final this month against Serie A leaders Inter Milan, who progressed in December with a 1-0 win over Livorno.
Mathieu Flamini earlier spared AC Milan's blushes by netting the winner nine minutes from time in a 2-1 last-16 victory over third tier Novara.
Striker Filippo Inzaghi, now 36 and often a substitute under manager Leonardo this season, had reminded Milan of his worth with a 12th-minute opener and other fine touches.
A second-string Milan side allowed Pablo Gonzalez to score just after the break but the hosts prevailed when Flamini's powerful strike set up a meeting with Udinese or Lumezzane, who play on Thursday.
The best features, fun and footballing quizzes, straight to your inbox every week.
Catania's Gianvinto Plasmati scored twice early on in a 2-1 win at nine-man Genoa and AS Roma beat second division Triestina 3-1 on Tuesday.
Holders Lazio are at home to Palermo in the last 16 on Thursday.
