Two goals from Ivan Perisic saw Inter come from behind to beat Udinese 2-1 at Stadio Friuli on Sunday.
The Croatia international cancelled out an opening goal from Jakub Jankto late in the first half before steering in a late header to give the visitors a fifth win in a row in all competitions.
Stefano Pioli had urged his side to start 2017 in a manner that would give them real belief in the hunt for the top three but it was Udinese who were by far the better team in the first half in Udine.
The home side, unbeaten in their previous four games, took a deserved lead through Janko and should have added to the tally in the opening half-hour, with Rodrigo de Paul hitting the post and Janko shooting just wide.
Perisic snatched Inter's equaliser seconds before the break to dampen some of the spirits in Udine, however, and the second half was a far more balanced and scrappy affair as both sides pushed for a winner without a huge amount of quality on show.
Ever Banega and Duvan Zapata missed good openings and substitute Joao Mario should have hit the winner before Perisic rose highest to power in a header three minutes from time.
The result sees Inter close back to within five points of third-place Napoli, who beat Sampdoria 2-1 on Saturday.
Udinese started promisingly, Samir Handanovic tipping a fierce swerving effort from Seko Fofana over the crossbar, before Antonio Candreva tested Orestis Karnezis as Inter began to settle.
The home side were the more inventive in the early stages and one fine move in the 17th minute gave them the opening goal. Samir was allowed space to drive towards the edge of the area and he slid a clever pass beyond the dummy run of Fofana and into the feet of Jankto, who steadied himself before side-footing past Handandovic.
De Paul then rattled the base of the post from point-blank range following Zapata's cross before Jankto raced into the area and dragged a shot just wide, as Inter's defending against the counter-attack continued to look unsteady.
Perisic thought he had levelled but the offside flag was correctly raised just as he steered the ball into the net, and only a good reflex stop from Handanovic prevented De Paul's deflected cross from making it 2-0 before the break.
But with just seconds left of stoppage time, Inter snatched an equaliser. Mauro Icardi worked some space to the left of the area and teed up Perisic, who side-footed first time past Karnezis - who should have done better - and into the bottom corner.
Both sides wasted good chances to take the lead just after half-time, with Banega volleying wide when unmarked at the far post before Zapata blasted beyond the side-netting following a good Udinese move.
Perisic fizzed a free-kick inches past Karnezis's right-hand post from 20 yards out before Joao Mario missed a great chance to win it eight minutes from time, with Silvan Widmer reacting superbly to stick a foot in the way of the Portuguese midfielder's shot from 12 yards after Karnezis had spilled the ball into his path.
But just as Inter fans began to sense that victory had got away from their side, Perisic leapt unmarked at the far post to head Joao Mario's curling delivery into the bottom-left corner of Karnezis's net and give Pioli's side an important boost in the race for Europe.