Serie A wrap: Inter comeback boosts Champions League hopes
The hosts raced to a 2-0 lead inside the opening 20 minutes thanks to goals from Gonzalo Bergessio and Giovanni Marchese, before Ricky Alvarez reduced the deficit just after half-time.
Rodrigo Palacio, whose introduction inspired Inter's second-half revival, got the equalising goal, and the hosts were left to rue the number of chances they missed as Palacio struck the winner deep into added time.
The win saw Inter move level with fourth-placed Lazio on 47 points, with both clubs a point behind AC Milan.
In other results, Fiorentina stay in sixth spot thanks to their 2-1 home win over Chievo.
Manuel Pasqua put Fiorentina ahead five minutes in, but Isaac Cofie levelled proceedings seven minutes before the interval.
Argentine substitute Marcelo Larrondo scored the winner in the 78th minute, giving Vincenzo Montella's side all three points.
An early goal from Antonio Di Natale handed Udinese a 1-0 win at relegation-threatened Pescara, while a strike from exciting prospect Mauro Icardi just before the hour mark gave Sampdoria a 1-0 triumph against Parma at the Stadio Luigi Ferraris.
Atalanta had a brace from Giacomo Bonaventura to thank for their 2-0 away win over Siena, and Bologna cruised to a 3-0 victory over Cagliari, who had defender Francesco Pisano sent off in the second half.