Andrea Stramaccioni made three changes from the side that beat Sampdoria in midweek, Walter Samuel, Esteban Cambiasso and Tommaso Rocchi coming in for Jonathan, the suspended Walter Gargano and the injured Rodrigo Palacio. Likewise, Stefano Colantuono made three changes with Ciro Polito, Lionel Scaloni and Carlos Carmona playing in place of Andrea Consigli, Stefano Lucchini and Maxi Moralez.
Both sides struggled to string together any meaningful sequence of passes early on and as a consequence, chances were hard to come by for each side. Antonio Cassano's teasing cross to the near post was missed by both Tommaso Rocchi and Esteban Cambiasso, whilst at the other end German Denis headed Davide Biondini's cross well wide.
Rocchi, on a goal drought lasting 14 months, came close to ending this, his header from Guarin's cross following a clever corner routine deflected just wide. After the resulting corner was headed wide by Andrea Ranocchia, Polito restarted play quickly and the counter came to Carlos Carmona down the left. He cut inside and shot but the effort was weak and Samir Handanovic easily gathered it.
Inter were beginning to dominate possession however Atalanta poured forwards every time they got the ball, and Davide Biondini fired over following a counter-attack.
On the half-hour mark, the one thing Inter didn't want to happen happened. Antonio Cassano pulled up with a hamstring problem and despite having it heavily strapped, had to come off soon after, leaving Inter with Tommaso Rocchi as their only fit senior striker. Ricky Alvarez was introduced in place of Cassano and was right in the thick of it, arriving late at the far post unmarked, but his side-footed volley was shinned and ended up out for a throw-in.
In the dying seconds of the half, Mateo Kovacic went on a mazy run and passed to Rocchi in the area. The veteran striker was allowed to turn and shoot but his shot was deflected just wide. The resulting corner was hit low towards the near post and Rocchi lost his marker to flick it into the goal and put Inter ahead, his 100th Serie A goal coming 14 months after his 99th.
Right from the off, the second half was a lot more open than the first with both teams streaming forward and tackles flying in in the midfield. German Denis had the first chance of the second period, turning Luca Cigarini's cross at goal but the effort was weak and Handanovic easily gathered.
After 11 minutes of cut and thrust from both sides, Atalanta were deservedly level. Substitute Marko Livaja, co-owned by Inter, crossed for Giacomo Bonaventura, his first touch taking him away from Andrea Ranocchia and his second a beautiful finish beyond Handanovic.
Almost instantly, Inter were back in front, communication between Polito and Guglielmo Stendardo breaking down to allow Ricky Alvarez to head in.
Just four minutes later and Inter appeared to have the points sewn up as Alvarez received the ball down the right hand side and turned Stendardo inside out before lashing a powerful finish past Polito for a wonderful solo goal.
Despite being two goals down, Atalanta still streamed forward every time they got the ball and four minutes after Ricky's second, they were awarded a penalty after Andrea Ranocchia lost his footing in the box and took Marko Livaja with him. The contact seemed accidental but Ranocchia was given a yellow card and German Denis stepped up to confidently place the ball into the bottom corner.
After more poking and prodding, Atalanta were deservedly level again, Denis skipping past Javier Zanetti and Ranocchia before firing low to Handanovic's right.
Sensationally, Atalanta then took the lead just six minutes after going level. Inter struggled to clear after a period of sustained Atalanta pressure and Giacomo Bonaventura got away from Alvaro Pereira down the right hand side. His pullback from the bye-line was met by Denis to cap a sensational hat-trick.
Inter poured forward in search of an equaliser however the Atalanta defence held true, Fredy Guarin hit a free-kick well over whilst a Ricky Alvarez cross-shot was just missed by a stretching Ezequel Schelotto, himself introduced for Cambiasso inside the last ten minutes.
More drama was to come in stoppage time, Cristian Raimondi sent off for an elbow on Andrea Ranocchia however Ranocchia dusted himself off to get into the box and on the end of a deflected Guarin cross. From just a couple of yards out and with an empty net, Ranocchia looked as if he'd given Inter a last-gasp draw however he somehow scuffed his effort and it ended up going back over his head for what was potentially the miss of the season. The referee blew his whistle to give Atalanta a wonderful victory which surely means they are safe from relegation, a full ten points clear of Genoa in the final spot.
Inter: Handanovic; Ranocchia, Samuel, Juan Jesus; Zanetti, Kovacic, Cambiasso, Pereira; Guarin; Cassano (Alvarez 32), Rocchi
Atalanta: Polito; Scaloni, Stendardo, Canini; Cigarini; Raimondi, Biondini, Carmona, Del Grosso; Bonaventura, Denis
Goals: Rocchi 44 (I), Bonaventura 56 (A), Alvarez 57, 61 (I), Denis pen 65, 71, 77 (A)
Sent off: Raimondi 90 +1 (A)