Second-half goals from Martin Caceres and veteran Alessandro Del Piero did the damage after the visitors had enjoyed the better of the first period.
Juve closed back to four points behind Milan, who beat Roma 2-1 on Saturday.
"It was a special match because historically it's also a particular game," said goalkeeper Gianluigi Buffon, who made a number of crucial stops in the first half.
"On top of that we still had the hope of making life difficult for those above us.
"Obviously if we hadn't won we'd probably have been finished. That way we had an extra stimulus to finish the season well."
The defeat means Inter, who have just one win in their last 10 league encounters, are down in eighth and still three points behind a Europa League finish.
"I regret that we played well for an hour and then conceded a goal from a set piece," said Inter coach Claudio Ranieri.
"It was our umpteenth lack of attention, leaving Caceres alone.
"That ended our match, they got better and we didn't have the force and determination to fight back as we did in the first half."
With one side desperate to keep hold of Milan's coat-tails and the other in need of a win to boost their European qualification chances, both sides went all out for the win.
Inter's Maicon played in Diego Milito on the edge of the box but his snap-shot was blocked by Buffon's feet.
Juve started to take control and Caceres found acres of space on the right to pick out Alessandro Matri but from close range he headed straight at Julio Cesar.
Arturo Vidal played in Caceres to feed Matri who blazed over.
Milito then took down a long ball and volleyed goalwards, Buffon parried but the Argentine forward thumped the rebound over from an angle.
Buffon made a couple of crucial stops to deny Joel Obi and Dejan Stankovic as Inter ended the half in the ascendancy.
Juve, however, started the second period better after Antonio Conte switched to a 3-5-2 formation and went in front just before the hour mark.
Claudio Marchisio let fly from outside the box and Cesar tipped the ball over.
But from Andrea Pirlo's resulting corner, Caceres was left all alone to head home from eight yards out.
Ranieri threw on an extra striker in Giampaolo Pazzini but the visitors were struggling to create clear chances like they did in the first half.
And Juve finished the game just after Vucinic had been denied by Cesar when one-on-one, as Vidal slipped in substitute Del Piero to finish expertly into the bottom corner.
Juve could even have had more as Giorgio Chiellini was played in behind the defence but tried to square the ball to Fabio Quagliarella, whose close range shot was miraculously blocked by Maicon on the line.
Cesar also made a flying save to keep out a Chiellini header late on.
Lazio put daylight between themselves and their Champions League rivals as a Mobido Diakite goal two minutes from time gave them a 1-0 win over Cagliari.
The crucial strike cemented the Romans in third place, three points ahead of Napoli, who were held 2-2 at home by Catania, and Udinese, who drew 1-1 at Palermo on Saturday, in the race for the final Champions League qualification position.
"It's a vital win which improves our Champions League hopes," said Giovanni Lopez, the assistant to coach Edy Reja, who spent the game in the stands serving a one-game ban.
Napoli coach Walter Mazzarri was furious his side had blown a two-goal lead.
"I'm very angry," he said. "We thought the game was over. We were feeble at 2-0.
"They could have finished off the game but we didn't. Sometimes we're naive, we're children."
What the stars mean:
★ Poor ★ ★ Promising ★★★ Good ★★★★ Very good ★★★★★ Exceptional