TORONTO - The San Jose Sharks rallied from a two-goal third period deficit to beat the Toronto Maple Leafs 3-2 in a shootout on Tuesday night.

Justin Braun and Joe Pavelski scored two minutes and seven seconds apart in the final period, Logan Couture landing the shootout winner for the Sharks, who were opening a four-game road trip.

Martin Jones was sturdy with 29 saves for the visitors and perfect in the shootout.

Zach Hyman and Auston Matthews scored for the Leafs, who have dropped two in a row and five of their last six (1-3-2). Frederik Andersen sharp with 40 saves.

Coming off their fourth loss in five games, the Leafs got on the board first, much of the early action surrounding Hyman.

With Matt Martin in the penalty box for boarding, Hyman got in front of a Brent Burns blast from the right point. The shot drilled the 24-year-old in the left knee and he remained down in pain immediately afterward, eventually helped off the ice by teammates Matt Hunwick and Morgan Rielly.

Hyman missed hardly a moment though, returning to score three minutes later.

He got his stick on Matthews's quick shot from the left faceoff circle, the 19-year-old set up initially by William Nylander. Matthews picked up his 21st point in 28 games, Hyman scoring for the fifth time this season.

It was also the seventh point in the last eight games for the Toronto native, who's become a favourite of head coach Mike Babcock for his tenacious play.

He blocked another shot on a later power play with his right leg.

Matthews, meanwhile, remained an influence in the early going, coming up with two quality chances late in the first. The latter saw him give-and-go with Hyman, Matthews slipping around the defence before getting the puck back and then firing a backhand attempt on Jones, one of his 12 first period saves.

Fresh after last starting on Saturday, a 32-save win in Boston, Andersen was every bit Jones's equal. The best of his perfect 14-save first period may have been on Mikkel Boedker shorthanded. Boedker found himself open in front, fed by Toronto-area native Joel Ward from the corner, but he was ultimately denied by Andersen who sharply anticipated the play.

Controversy came in the opening minutes of the second frame when Morgan Rielly appeared to give the Leafs a 2-0 lead. The goal was immediately waved off though on account of goaltender interference, Nazem Kadri bumping Jones as he strode to the net. Kadri was also assessed a minor penalty.

Both Kadri and Leafs coach Mike Babcock protested vociferously, Babcock ultimately using his coach's challenge. The call stood, however, and the goal was denied.

Toronto got the goal back a short while later.

Cold on the power play recently (2 for 20 in the previous six games), the Leafs broke through with a five-on-three advantage about eight minutes into the second. Again it was Matthews, his shot from just above the goal-line slipping under Jones' left pad. The goal was Matthews's team-leading 13th this season, Nylander adding his second assist of the evening.

It was the fifth multi-point outing of the year for Matthews, who trails only the Jets' Patrik Laine among rookies with 22 points.

Andersen helped keep his team in front throughout, in perfect position to shut down a Boedker rush, later sliding from left to right to deny David Schlemko. San Jose outshot Toronto 12-7 in the middle frame, wearing the Leafs down with a few sustained stints in the offensive zone.

The Sharks grabbed an early third period power play and nearly scored when Joe Pavelski found himself open just in front of Andersen. Rookie Connor Brown managed to get a stick on the attempt, however, and send it over the net and into the crowd.

Braun got the visitors on the board though just beyond the midway point of the final frame, whipping a backhand from the slot over the glove of Andersen. It was the first goal of the season for the 29-year-old from Saint Paul, Minn.

Pavelski followed him up just over two minutes later, the Sharks finally cracking the Leafs' penalty kill. The San Jose captain managed to guide a Brent Burns point pass beyond past Andersen, evening the score at two.

The Leafs had numerous chance to score in overtime, Jones brilliant in stopping attempts from Kadri and Marner. He continued his strong play in the shootout, denying Marner, Matthews and Nikita Soshnikov.

Toronto fell to 10-1-5 when leading after two periods.