SAN JOSE -- Tomas Hertl scored the game-winning goal with 1:24 remaining, and the San Jose Sharks defeated the Toronto Maple Leafs 3-1 at SAP Center on Tuesday.
Patrick Marleau dropped a pass to Hertl, who beat goaltender Frederik Andersen to the short side from the left faceoff circle to put San Jose ahead 2-1.
"I wasn't sure if it was in, but Patty made a great play to hold the puck and free guys in the [offensive] zone," Hertl said.
WATCH: All Maple Leafs vs. Sharks highlights
Joe Pavelski scored into an empty net with 23 seconds left to make it 3-1. Joe Thornton got his 999th NHL assist on the goal.
Brenden Dillon scored, and Martin Jones made 20 saves for the Sharks (37-18-7, 81 points), who lead the Edmonton Oilers by five points for first place in the Pacific Division.
Auston Matthews scored, and Andersen made 34 saves for the Maple Leafs (28-21-13), who have lost three straight (0-1-2).
"It's a tough way to end a game," Andersen said. "We were close to getting a point at least and having a chance to win it. Tough last play there. You hate to see it happen."
Video: TOR@SJS: Dillon whistles a slap shot into the cage
Matthews gave Toronto a 1-0 lead at 6:41 of the second period when he scored on the power play. His 31 goals are tied for second in the NHL with fellow rookie Patrik Laine of the Winnipeg Jets and Max Pacioretty of the Montreal Canadiens, three behind Sidney Crosby of the Pittsburgh Penguins.
Dillon scored his second goal of the season at 12:17 of the second to tie the game 1-1. He took a cross-ice pass from Kevin Labanc and beat Andersen with a slap shot from above the right circle.
"We had a good shift there," Dillon said. "We were kind of buzzing down low. We were having the cycle game. I think we got them a little tired, and [Labanc] made a great play through the middle. I kind of got my head up, had a little bit of time, so I thought I'd try the slapper instead of the wrist shot, and I was fortunate to find a hole."
Veteran center Brian Boyle made his Maple Leafs debut one day after being acquired in a trade from the Tampa Bay Lightning. He played on the fourth line with Matt Martin and Josh Leivo, as well as on the penalty kill. He had one shot on goal, one hit and one blocked shot in 12:33 of ice time.
"It's always tough in this building," Boyle said. "It's a real good team we're playing. If we want to get to where we want to get to, you have to win these hard road games. It all comes down to who gets the next one at the end. That was the focus. I just tried to do my part."
Goal of the game
Leivo sent a pass from the right circle to Matthews in the slot, and the rookie beat Jones with a shot to the right corner of the net. "It was a really nice play all around," Matthews said. "We kind of caught them on a change, and [William Nylander] just maneuvered around, and [Leivo] made an unbelievable pass to me. I just tried to get it off my stick as quick as possible."
Video: TOR@SJS: Matthews slams home Leivo's feed for PPG
Save of the game
Andersen gloved Joel Ward's shot from the slot with 4:04 left in the first period on a 2-on-1 rush during a power play.
Video: TOR@SJS: Andersen robs Ward's wide-open shot
Unsung performance of the game
San Jose center Logan Couture slid to block Matt Hunwick's shot with 4:34 left in the third period. His four shots on goal were tied with Marleau and Dillon for the Sharks lead, and he won nine of 16 faceoffs (56.3 percent).
Highlight of the game
Marleau drew three Maple Leafs to him before sending the puck to Hertl in the left circle for the game-winner.
Video: TOR@SJS: Hertl goes short side to give Sharks lead
They said it
"They were physically stronger and more determined on pucks than we were. We have to be better at those things. Every once in a while you get a lesson, and you have to learn the lesson." -- Maple Leafs coach Mike Babcock
"We just stuck with it. I loved our first period. We were unfortunate to be out of that period without being up. We should have been up. Second period, I thought they pushed back a little, and I thought the third we put our foot back on the gas again and finally got rewarded." -- Sharks coach Peter DeBoer
Need to know
During the game, the Sharks acquired forward Jannik Hansen in a trade from the Vancouver Canucks for forward Nikolay Goldobin and a conditional fourth-round pick in the 2017 NHL Draft. ... Maple Leafs forward Mitchell Marner returned to the lineup after missing five games with an upper-body injury. ... Toronto center Tyler Bozak returned to the lineup after missing one game because of an infected cut on his finger. ... Maple Leafs forward Matt Martin played his 500th NHL game.
Maple Leafs: At the Los Angeles Kings on Thursday (10:30 p.m. ET; FS-W, SNO, NHL.TV)
Sharks: Host the Vancouver Canucks on Thursday (10:30 p.m. ET; CSN-CA, SNP, NHL.TV)
Video: Hertl, Jones lead Sharks to 3-1 victory over Leafs