TORONTO -- The Toronto Maple Leafs are going back to the playoffs.

Connor Brown scored the go-ahead goal with less than three minutes left in regulation as the Leafs clinched their first playoff berth since 2013 with a 5-3 victory over the Pittsburgh Penguins on Saturday night.

James van Riemsdyk, Tyler Bozak, Kasperi Kapanen and Auston Matthews also scored for the Leafs and Curtis McElhinney stepped in for an injured Frederik Andersen with 12 saves.

The Leafs will play the Ottawa Senators in the first round of the playoffs if they pick up at least a point in their season finale against Columbus on Sunday.

Phil Kessel, Sidney Crosby and Jake Guentzel all scored for Pittsburgh, which sat a number of regulars in advance of the post-season. Marc-Andre Fleury gave up four goals on 30 shots.

It's quite the turnaround for Toronto, both from last season and from the time of the last playoff berth four years earlier.

At about this time last year the club was wrapping up 30th place in the NHL which helped them land the best odds to pick Matthews first overall at the 2016 draft.

Matthews became the first player in history to score four goals in his NHL debut, his rapid emergence, alongside a historic class of rookies, central to the Leafs leap up the standings.

Beyond that, the Leafs have had Andersen deliver in his first year as a starter and others like Nazem Kadri, Jake Gardiner and Bozak enjoying career years.

Kadri, Gardiner, Bozak, Riemsdyk and Leo Komarov are the only remaining members of the Leafs last playoff team in 2013. The organization has been dramatically overhauled since with Brendan Shanahan taking over as president, Mike Babcock as head coach and Lou Lamoriello as general manager.

The roster has been turned over almost entirely too with the club also sporting a new logo and uniforms this season.

Tension was evident in the Air Canada Centre crowd early given the stakes for the hometown Leafs.

It was a member of the last Leafs playoff squad in 2013 who opened the scoring, Kessel beating Andersen far blocker side for his 23rd goal of the season six minutes in. Boos rained down on Kessel, Toronto's leading scorer for six seasons, and hearing those jeers the 29-year-old flashed a big, wide grin.

Before his goal was even announced the Leafs struck back with Kessel's former linemate, van Riemsdyk, evening the score at one. Van Riemsdyk gained control of the puck by batting down Bozak's pass with one hand on his stick as he crossed the blue line. He then danced around Penguins defenceman Justin Schultz and beat Fleury for his 27th goal this year.

The 27-year-old had two more great chances to score again later in the period, both denied by Fleury.

Toronto, as one might expect in those circumstances, owned the action in the early-going -- shot attempts favouring the Leafs 23-7 after the first.

Things turned dicey for the Leafs though two minutes into the second when Andersen was bumped in the head by the hip of Penguins forward Tom Sestito. Clutching his head, Andersen stayed down on the ice in obvious discomfort and after undergoing consultation with a team trainer, left the ice.

Two weeks earlier, in a game against Buffalo, Andersen was bumped in the head by Sabres forward William Carrier and forced to sit out a start with an undisclosed injury.

Sestito drew a penalty for goalie interference on the play, Bozak proceeding to put the Leafs ahead with the power play. Setting up the goal, William Nylander set a new team rookie record with his 26th power-play point of the year.

But whatever momentum Toronto gained was dashed when the Penguins scored on a power play of their own, Crosby notching his NHL-leading 44th goal of the year. McElhinney made the first save on Schultz, but couldn't recover in time to stop Crosby, who was set up by Guentzel.

Guentzel, who's shined as a rookie for the Penguins, could have given Pittsburgh the lead early in the third, but missed with an open cage. He got lucky a little while later though, his innocent shot bouncing off a pair of Leafs defencemen before sliding through the pads of McElhinney for the 3-2 lead.

Kapanen pulled the Leafs back even about 10 minutes later with his first NHL goal and point, depositing a nifty pass from Matt Hunwick.

Brown then redirected a Gardiner shot to put Toronto in front, Matthews adding his 40th goal of the year into an empty net.