The centre-back rose highest shortly after the break to nod in the only goal of a closely contested match between two of Italy's footballing powerhouses.
Victory in Turin sends Juventus to top spot in the table, although Inter Milan will have the chance to restore their two-point lead when they host Udinese on Saturday.
"Winning this evening was very important, because we put Napoli at -12 and that is a great result," said Juventus coach Massimiliano Allegri to 'DAZN'.
"As for dreams and the Scudetto, we need to keep improving step by step, especially when we make too many mistakes," he added.
Fifth-placed Napoli had the better of the opening exchanges and looked the more likely side to break the deadlock in the first half. Matteo Politano fizzed one just past the Juve goal on nine minutes and Khvicha Kvaratskhelia had the best early chance just before the half-hour mark.
Excellent hold-up play by Victor Osimhen sucked in the hosts' defence before he squared to his Georgian teammate, who uncharacteristically snatched at the chance and ballooned it over the bar.
Then, 11 minutes later Giovanni Di Lorenzo looked certain to open the scoring after a defensive mix-up, but Wojciech Szczesny flew off his line to make a fine one-handed save to keep things level.
The home team started the second half strongly and Dusan Vlahovic rattled the post on 49 minutes, following good play by Manuel Locatelli and Weston McKennie.
Two minutes later, Andrea Cambiaso collected a Napoli clearance and swung the ball into the box and onto the forehead of Gatti, whose towering header at the back post was enough to separate the sides. It was the 25-year-old's second consecutive winning goal for Juventus, after his 94th-minute strike at Monza last Friday.
Sz
Read on besoccer.com