TORONTO — The Maple Leafs got most of what they wanted through 40 minutes Friday.

After a week of frustrating efforts, Toronto battened down the hatches defensively, stayed out of the penalty box and generated a number of scoring chances.

There was one small detail missing from the equation — goals.

And on a team chalk full of talent up front, a bruising defenceman got the ball rolling before Toronto's best blue-liner stepped up late.

Jake Muzzin tied things in the dying moments of the second period and Morgan Rielly scored the winner with under six minutes to go in regulation as the Leafs downed the San Jose Sharks 4-1.

Toronto entered a scuffling 1-2-1 over its last four games, including Monday's 4-3 overtime loss to Columbus and Tuesday's 4-2 defeat at Boston — a result that prompted star centre Auston Matthews to call out both himself and his teammates.

To a man, the Leafs responded with their most complete effort of the season.

"We were motivated," Rielly said. "When you look back at our past couple games, there's room for improvement.

"We're aware of that, we talked about that, been pretty open about that."

Ilya Mikheyev, with a goal and an assist, and Matthews scored in the final minute for Toronto (6-4-2) in a game that was much closer than the final score indicated. Frederik Andersen made 16 saves.

Kevin Labanc replied for San Jose (4-6-1), while Martin Jones made 23 stops for a tired team that beat Montreal 4-2 just 24 hours earlier.

"We put ourselves in a position to win," Sharks captain Logan Couture said. "You're going to have nights like tonight where you're not feeling it and you're not getting much offensively."

San Jose's 17 shots were the fewest allowed by Toronto since the Ottawa Senators wracked up the same total on March 12, 2016.

"We didn't give up much," Leafs head coach Mike Babcock said. "(We) stayed the course, got the break there at the end of the (second) and then just stayed patient in the third."

On the winner, Rielly took a pass from William Nylander off the rush and buried his third of the season upstairs on Jones with 5:29 left.

"Just an all-around group effort," Rielly said. "It's important that we focus on that moving forward ... and try to do it again."

Tied 1-1 heading to the third, Toronto couldn't do anything on two early power plays — falling to 0 for 5 on the night — before Andersen made a pad save on Evander Kane on one of San Jose's few chances.

Matthews then ripped a shot off the rush with under eight minutes to play that Jones smothered before Mitch Marner stickhandled around the Sharks goalie on the next shift, but couldn't quite tuck his effort home.

After the Leafs pushed ahead 2-1, the Sharks pulled Jones for the extra attacker. Kasperi Kapanen inexplicably missed the empty net from in tight, but Mikheyev iced it with 47.5 seconds left as Toronto breathed a huge sigh of relief.

Matthews scored his ninth with Jones back between the pipes to make it 4-1.

Down 1-0 late in the middle period in front of an increasingly restless crowd of 19,102 at Scotiabank Arena, the nervous-looking Leafs pulled even with 1.9 seconds left on the clock when Muzzin floated down in front of the Sharks' net and buried a feed from Jason Spezza.

"Even if they get the puck it'll be tough to get down the ice and score," Muzzin said of his decision to pinch. "It was a big goal for the team to get us going."

Matthews took a thundering hit from San Jose defenceman Brenden Dillon midway through the period at the offensive blue line. The Toronto centre finished his shift and drew a tripping penalty, but headed to the quiet room before returning for the third.

"I felt like it was a hit to the head," Matthews said. "It's a fast game. Refs are trying to make the best judgement, but I know what I felt.

"We picked up two points. It's all that matters."

Friday marked the return of Patrick Marleau to Toronto after he signed with his old team earlier this month. The 40-year-old winger spent the last two seasons with the Leafs, and developed a strong relationship with Matthews and Marner.

The trio posed for a picture during warmups.

Toronto wanted to get off to a fast start and could have easily gone up big early before the Sharks opened the scoring.

Matthews and Nylander had good chances on an early man advantage before Rielly and Alexander Kerfoot both came close at even strength.

But the visitors weathered that storm and got on the board midway through the first when Labanc tipped a Brent Burns point shot past Andersen.

"Our first five minutes was unreal, we could have had four," Babcock said. "We had a turnover, they scored.

"But instead of getting crazy we just stayed with it, stayed with it, stayed with it."

Notes: The Leafs, who visit Montreal on Saturday, played the front end of their third back-to-back already this season. ... Marleau played his 1,500th career game in a San Jose uniform. ... Honoured with a video tribute during the first television timeout at Scotiabank Arena, Marleau has now suited up 1,663 times in the NHL with the Sharks and Leafs, and is the seventh player in NHL history to dress for 1,500 games with one team.

This report by The Canadian Press was first published Oct. 25, 2019.

___

Follow @JClipperton_CP on Twitter