It was a catastrophic result in more ways than one for the Nerazzurri, whose hopes of making the Champions League next season are fading fast, while an injury to Antonio Cassano further hampers their already depleted front line.
Tommaso Rocchi gave Inter a narrow lead at the break, and a brace off the bench from Ricky Alvarez looked to have given them all three points after an equaliser from Giacomo Bonaventura.
But then, Denis took over. The Argentine struck from the penalty spot with 19 minutes remaining, before twice finishing clinically at the near post to give the visitors an unlikely lead which they would not relinquish, despite Cristian Raimondi's late red card.
Inter now face an eight-point gap to third placed AC Milan, and can even slip out of Europa League contention should Lazio achieve a result in the Rome derby on Monday.
Esteban Cambiasso returned from suspension to start in midfield for the hosts, who also turned to January signing Rocchi to partner Antonio Cassano up front, with Rodrigo Palacio and Diego Milito injured.
And the absence of their leading scorer seemed to blunt Inter’s attacking edge early on, as they struggled to create many clear cut chances during the opening exchanges.
Cassano curled a long-range effort wide of the left post, but the home side’s first real opening arrived with nearly half an hour gone, as Fredy Guarin’s cross from the byeline was met by Rocchi, but deflected just off target.
The sight of Cassano clutching his hamstring was one Inter could have definitely done without, and with 32 minutes on the clock, the forward would succumb to the injury, making way for Alvarez.
However, the substitute almost made an immediate impact when presented with a golden shooting opportunity from Alvaro Pereira’s delivery, but his attempt was sliced terribly, and rolled out for a throw in.
Surprisingly, Cassano’s departure seemed to signal an upturn in Inter’s attacking momentum, as Alvarez found space to shoot on two occasions, before Rocchi saw another effort deflected just wide.
And Rocchi would not be denied a third time. With only a minute to go until the break, Pereira’s corner was judged poorly by Ciro Polito, allowing the veteran striker all the time he needed to lash into the roof of the net from the near post.
But 10 minutes after the restart, Atalanta would equalise. Substitute Marko Livaja’s cross was missed completely by Walter Samuel, giving Bonaventura space to steal in ahead of Andrea Ranocchia and lift the ball over Samir Handanovic.
However, that lead would last all of two minutes. Michele Canini’s back header sold Polito short, and Alvarez stole in to poke home, leaving Atalanta furious after appeals for a foul on Guglielmo Stendardo by Rocchi went unheeded.
Alvarez would add another just after the hour mark, and this time, there was no doubt about the legitimacy of his goal. Collecting the ball on the right side of the box, the midfielder cut in past his marker and drilled home expertly at the near post.
But the pendulum swung Atalanta’s way three minutes later. Livaja drew a foul on Ranocchia in the area, and Denis stepped up to bury the resulting penalty.
And with 71 minutes gone, the visitors would fight back again. Denis took advantage of miscommunication in the Inter defensive ranks to drive in a low shot past Handanovic at the near post.
Atalanta’s comeback was completed in grand fashion with 13 minutes remaining by Denis, who stabbed home Bonaventura’s cross to round off a magnificent hat-trick.
Raimondi was given his marching orders in injury time for a violent outburst on Ezequiel Schelotto, but Inter could have won the game late on when Ranocchia only had to tap into an empty net, but somehow, to the disbelief of the entire stadium, contrived to shoot over the bar.