The hosts made a dominant start to the match and Miguel Britos almost gave them an early lead when his header was turned wide of the post.
© Getty Images
The visitors then wasted a huge opportunity to break the deadlock when Giulio Migliaccio's strike deflected kindly into the path of Alejandro Gomez, but from just a few yards out, the striker put his effort over the bar.
As the first half progressed Napoli enjoyed plenty of possession and Manolo Gabbiadini caused the Atalanta defence a moment of panic with a powerful free kick that was beaten to safety by Marco Sportiello.
The teams went into the break on level terms, but within three minutes of the second half Gonzalo Higuain saw his close-range attempt blocked by the keeper.
Atalanta were then dealt a blow as Gomez was sent off after picking up a second yellow card for a foul on Jose Callejon.
Napoli almost made their numerical advantage count straight away, but Jonathan de Guzman could only place his low strike against the outside of the post.
Despite the home side's dominance, it was Atalanta who took a shock lead in the 72nd minute as Mauricio Pinilla stole possession from Henrique and rounded Andujar before sliding the ball into the empty net.
It seemed as if Atalanta would hold on to claim the points, but with a minute of the game left to play Marek Hamsik whipped in a cross to the back post and Zapata rose highest to power a header into the net.
In stoppage time Hamsik almost snatched the win for the hosts, but his effort skidded inches wide of the post as Napoli saw their hopes of qualifying for the Champions League take a damaging blow.