D'Agostino collected Giuseppe Sculli's neat pass to break the deadlock with a fierce 20-yard strike on 24 minutes.
Pescara's lead lasted for just nine minutes as Denis levelled the scores with a penalty.
Atalanta continued to be on the front foot after half time and deservedly went ahead on 67 minutes.
Denis rifled the ball high into the roof of the net following a pinpoint cross from Davide Biondini.
The result sees Atalanta claim back-to-back victories for the first time since November.