Matthews missed the past 14 games after sustaining a left shoulder injury Oct. 27 against the Winnipeg Jets.
"After the first I felt terrible; second period, I didn't feel too good, and I think in the third period I finally got my legs under me and I was kind of skating out there a little bit more," Matthews said. "That's kind of expected with that first game back. It's tough to get into game shape when you're just in practice."
WATCH: [All Sharks vs. Maple Leafs highlights]
John Tavares scored twice, Patrick Marleau scored, Mitchell Marner had three assists, and Frederik Andersen made 38 saves for the Maple Leafs (18-8-0), who have won three in a row and 10 of their past 13.
"I don't know if we skated as good as we normally skate," Maple Leafs coach Mike Babcock said. "We have good players and found a way to play good enough and win. It was a big win for us against a good team."
Tomas Hertl, Joe Pavelski and Melker Karlsson scored; Logan Couture had two assists and Aaron Dell made 24 saves for the Sharks (12-9-5), who have lost three in a row.
"Yes, we got away from how we needed to play, we didn't play the way we needed to," Couture said. "We played it in spurts. I thought a large part of the second period we did [what we needed to]. I thought we played well in the second half of the game and generated a lot of opportunities but too many easy goals for them."
The Maple Leafs took a 1-0 lead at 3:38 of the first period when Tavares scored off a pass from Matthews at the right side of the crease on the power play.
"I felt like three guys were covering Mitch and so I was wide open when I got the puck. I could have shot it but John was wide open back door," Matthews said. "When we're moving the puck around using each other it seems to be pretty evident we have a lot of weapons."