William Nylander scored the go-ahead goal midway in the third period to lift the Toronto Maple Leafs over the Florida Panthers 5-3 on Thursday night.

Auston Matthews, Kasperi Kapanen, Mark Hyman and Justin Holl also scored for Toronto. Frederik Andersen stopped 24 shots in his sixth straight start.

More Images
Toronto Maple Leafs right wing Kasperi Kapanen (24) is congratulated after his goal during the first period of the team's NHL hockey game against the Florida Panthers, Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

William Nylander scored the go-ahead goal midway in the third period to lift the Toronto Maple Leafs over the Florida Panthers 5-3 on Thursday night.

Toronto Maple Leafs center Auston Matthews (34) battles Florida Panthers goaltender Sergei Bobrovsky (72) and right wing Evgenii Dadonov (63) at the net during the second period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

With the score tied at 3, Nylander put the Maple Leafs ahead when he grabbed a loose puck in front and put it past Bobrovsky with 11 minutes left in the third.

Florida Panthers center Aleksi Saarela (28) and Toronto Maple Leafs center Alexander Kerfoot (15) compete for the puck during the second period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

Each team scored three goals in a wild first period.

Toronto Maple Leafs right wing Mitchell Marner (16) attempts a shot at Florida Panthers goaltender Sergei Bobrovsky during the second period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

The Panthers took a 1-0 lead when Pysyk one-timed a pass from Aaron Ekblad from the right circle 2:23 in.

Toronto Maple Leafs left wing Zach Hyman (11) congratulates center Auston Matthews (34) after Matthews scored during the first period of the team's NHL hockey game against the Florida Panthers, Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

UP NEXT

Florida Panthers center Aleksi Saarela (28) takes down Toronto Maple Leafs defenseman Travis Dermott (23) during the first period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

Florida Panthers center Aleksi Saarela (28) takes down Toronto Maple Leafs defenseman Travis Dermott (23) during the first period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

Toronto Maple Leafs center Auston Matthews (34) slams Florida Panthers defenseman MacKenzie Weegar (52) against the boards during the first period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

Toronto Maple Leafs center Auston Matthews (34) slams Florida Panthers defenseman MacKenzie Weegar (52) against the boards during the first period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

Mike Hoffman, Noel Acciari and Mark Pysyk scored for the Panthers, while Sergei Bobrovsky made 24 saves.

Toronto Maple Leafs right wing Kasperi Kapanen (24) is congratulated after his goal during the first period of the team's NHL hockey game against the Florida Panthers, Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

Toronto Maple Leafs right wing Kasperi Kapanen (24) is congratulated after his goal during the first period of the team's NHL hockey game against the Florida Panthers, Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

With the score tied at 3, Nylander put the Maple Leafs ahead when he grabbed a loose puck in front and put it past Bobrovsky with 11 minutes left in the third.

Holl’s empty-net goal with 20.8 seconds remaining stretched the lead to 5-3.

Toronto has won three of their past four games. The Panthers have lost three of four.

Toronto Maple Leafs center Auston Matthews (34) battles Florida Panthers goaltender Sergei Bobrovsky (72) and right wing Evgenii Dadonov (63) at the net during the second period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

Toronto Maple Leafs center Auston Matthews (34) battles Florida Panthers goaltender Sergei Bobrovsky (72) and right wing Evgenii Dadonov (63) at the net during the second period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

Each team scored three goals in a wild first period.

Trailing 3-1, the Maple Leafs closed to 3-2 when Kapinen’s shot from the left circle beat Bobrovsky with 2:17 left in the first. Matthews tied it when he poked in a rebound with 1:02 left.

With the score tied at 1, Hoffman put the Panthers ahead 2-1 when he found a rebound in front and shot it into the open net at 7:25. Acciari’s shot from the right circle hit the post on the far side and went in at 12:36 and made it 3-1.

Florida Panthers center Aleksi Saarela (28) and Toronto Maple Leafs center Alexander Kerfoot (15) compete for the puck during the second period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

Florida Panthers center Aleksi Saarela (28) and Toronto Maple Leafs center Alexander Kerfoot (15) compete for the puck during the second period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

The Panthers took a 1-0 lead when Pysyk one-timed a pass from Aaron Ekblad from the right circle 2:23 in.

The Maple Leafs answered 1:09 later after Hyman poked a rebound past Bobrovsky to tie it at 1.

NOTES: Maple Leafs C Denis Malgin, acquired from the Panthers on Feb. 19, was a healthy scratch. ... Toronto D Jake Muzzin will miss four weeks with a broken hand sustained in a 4-3 win at Tampa Bay on Thursday. ... Florida's Joel Quenneville became the 2nd NHL head coach to reach 1,700 games. Scotty Bowman coached 2,499 NHL games. ... Ekblad’s assist on Pysyk’s goal gave him a career-high 39 points. ... Panthers F Erik Haula played his 400th NHL game.

Toronto Maple Leafs right wing Mitchell Marner (16) attempts a shot at Florida Panthers goaltender Sergei Bobrovsky during the second period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

Toronto Maple Leafs right wing Mitchell Marner (16) attempts a shot at Florida Panthers goaltender Sergei Bobrovsky during the second period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

UP NEXT

Maple Leafs: host Vancouver on Saturday.

Panthers: host Chicago on Saturday.

—-

More AP NHL: https://apnews.com/NHL and https://twitter.com/AP_Sports

Toronto Maple Leafs left wing Zach Hyman (11) congratulates center Auston Matthews (34) after Matthews scored during the first period of the team's NHL hockey game against the Florida Panthers, Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

Toronto Maple Leafs left wing Zach Hyman (11) congratulates center Auston Matthews (34) after Matthews scored during the first period of the team's NHL hockey game against the Florida Panthers, Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

Florida Panthers center Aleksi Saarela (28) takes down Toronto Maple Leafs defenseman Travis Dermott (23) during the first period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

Florida Panthers center Aleksi Saarela (28) takes down Toronto Maple Leafs defenseman Travis Dermott (23) during the first period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

Toronto Maple Leafs center Auston Matthews (34) slams Florida Panthers defenseman MacKenzie Weegar (52) against the boards during the first period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)

Toronto Maple Leafs center Auston Matthews (34) slams Florida Panthers defenseman MacKenzie Weegar (52) against the boards during the first period of an NHL hockey game Thursday, Feb. 27, 2020, in Sunrise, Fla. (AP PhotoWilfredo Lee)