Juventus were stunned after just four minutes when Stefan Radu rose to beat Marco Storari with a powerful header from a free-kick after Paul Pogba had given away a needless foul on the right flank.
Juve got back on level terms thanks to Giorgio Chiellini's half-volley in the 10th minute.
The match finished all square after 90 minutes but Matri, back on loan at Juve after being sold to Milan in 2013, made the difference when he latched on to Carlos Tevez's lay-off inside the area to bundle past Etrit Berisha in the Lazio net.
Juve held on to their lead amid a tense second period of extra-time to send the black and white half of the Stadio Olimpico into raptures as the champions secured their first league and cup double since 1995.
“It's our first cup trophy in 20 years, so it's obviously special for us,” said Matri.
Juve now just have to focus on the Champions League final against Barcelona in Berlin on June 6th to complete their season and emulate the treble feats of Inter Milan, in 2010.
“It was a great final,” said Juve coach Massimiliano Allegri. “Now we just have to keep our focus until June 6th.
“We'll go to Berlin having won the league and the cup, but Barcelona are in great form, just as we are.”
Allegri was missing midfielder Claudio Marchisio and striker Alvaro Morata through suspension, and was also without number one goalkeeper Gianluigi Buffon, whose absence was felt almost immediately when Storari struggled to reach Radu's powerful header from a free-kick on the right.
Yet Juventus, who beat Lazio 3-0 and 2-0 in their Serie A encounters this season, were soon back on level terms.
The fingers of blame had pointed at Chiellini after Radu's opener, but the big Juve defender was in the right place at the right time when Andrea Pirlo fired in a free-kick from 25 metres out on 10 minutes.
Pirlo's curling delivery was headed into the area by Pogba and Chiellini was left enough space to connect and beat Berisha with a close-range volley.
Fernando Llorente fired a header just over Berisha's bar and after Pirlo saw a free-kick blocked and what followed displayed Lazio's threat on the counter.
Tense second half
Brazilian Felipe Anderson carried the ball all the way through the Juve midfield to offload for Danilo Cataldi, forcing Buffon to go down low to collect.
Chances were few in a far more tense second half and Lazio striker Miroslav Klose was almost invisible before being replaced by Felip Djordjevic seven minutes from time.
Instead, Antonio Candreva and Anderson were running the show for the Biancocelesti, albeit with little reward.
Allegri replaced Pogba with Pereyra on 78 minutes and his freshness told immediately, the Argentine tracking back to dispossess Anderson as the Brazilian held possession in a dangerous three-on-three.
Lazio spurned a great chance to claim a late winner, however, when Djordjevic made a complete mess of a one-on-one with Storari.
Matri, who replaced Llorente six minutes from time, had the ball in the net moments after his arrival only for the goal to be ruled offside.
Lazio spurned another great chance to clinch the cup when Djordjevic turned and fired a drive which beat Storari only to come off the near post and rebound across the goalmouth.
But Matri, who has played for four different clubs since joining Juventus in 2011, made the most of his opportunity.
Tevez did well to control a long ball and drew two defenders before laying off for Matri to fire inside Berisha's near post and send the Curva Nord into raptures.