Six goals were scored in a Coppa Italia final for the first time since Roma beat Inter 6-2 in 2007
Hakan Calhanoglu's 80th-minute penalty forced extra time and Ivan Perisic scored twice in three minutes as Inter lifted the cup for the eighth time.
Nicolo Barella's superb strike had put Inter ahead after six minutes.
But holders Juventus scored twice in quick succession through Alex Sandro and Dusan Vlahovic to turn the game around early in the second half.
Defeat ended record 14-time winners Juventus' hopes of a trophy this season - the first time that has happened since 2010-11.
Serie A title chasers Inter, who are second and two points behind city rivals AC Milan with two games to go, had not reached the final of the competition since their previous triumph 11 years ago.
Barella gave Inter the perfect start when he curled a sublime right-foot shot into the top corner after cutting inside from the left to score the fastest Coppa Italia final goal since 2015.
Samir Handanovic produced a fine save to deny Vlahovic and Paulo Dybala shot wide as Juventus chased an equaliser before the break.
But Massimiliano Allegri's side were ahead within seven minutes of the restart thanks to goals from Sandro and Vlahovic, who followed up his own saved effort after a quick counter-attack.
Calhanoglu held his nerve to force extra time after Lautaro Martinez was brought down by Leonardo Bonucci, and Perisic then stepped up from the penalty spot to put Inter back in front after 99 minutes.
Perisic added a stunning fourth just three minutes later, taking a touch before firing into the top corner from the edge of the box to put the contest out of Juventus' reach.
Inter will now face Cagliari and Sampdoria in their final two league games as they pursue a domestic double.
-- Courtesy of BBC Sport