Juventus captain Giorgio Chiellini had a game to forget in his 400th Serie A appearance as he handled the ball to give away the game’s only goal, with Lorenzo Insigne scoring the penalty.
Alvaro Morata had a potential equaliser disallowed as Chiellini was offside.
Napoli keeper Alex Meret had an excellent game to deny Federico Chiesa, Morata and Cristiano Ronaldo.
Italian media reports had suggested that Gattuso could be sacked by Napoli if they lost this game, but the win takes them up to fourth place, only two points behind Juve.
Juve, who had only dropped points once in Serie A since 22 December, are seven points behind leaders AC Milan. The gap will be 10 points if they beat Spezia at 19:45 GMT.