SAN JOSE -- Wyatt Johnston scored his first NHL hat trick and had two assists for the Dallas Stars, who rallied from three goals down late in the third period to defeat the San Jose Sharks 7-6 at SAP Center on Tuesday.

"We know that we can come back no matter the situation," Johnston said. "I think we've proved that this year."

Roope Hintz won it at 1:49 of overtime. He skated into the zone off the bench, took a pass from Logan Stankoven, and beat Kaapo Kahkonen blocker side from the high slot.

"It's nice to get the two points," Stankoven said. "We don't want to play like that again. I think, obviously, a high-scoring game, that’s not the type of hockey that's going to lead in the playoffs. We got to shut it down a bit more."

DAL@SJS: Hintz snaps a sweet shot into the twine for the OT winner

Stankoven had two goals and two assists, Jamie Benn had a goal and three assists, and Miro Heiskanen had four assists for the Stars (38-17-9), who hadn't played since a 3-2 shootout win against the Sharks on Saturday. Jake Oettinger made 14 saves.

"I think when you play an 82-game schedule, you've got to find all kinds of different ways to win games. 1-0, 2-1, 7-6," Dallas coach Pete DeBoer said. "I think that's probably the only silver lining tonight, we found a way to come out of here with two real important points. Obviously, didn't play the game we wanted to. You don't want to get in a shootout like that. That's not our game, but we found a way and we'll move on."

Anthony Duclair had two goals and two assists, Fabian Zetterlund had a goal and two assists, and Mikael Granlund had a goal and an assist for the Sharks (15-39-7), who have lost eight straight (0-6-2). Kahkonen made 33 saves.

"This one stings, probably worse than the 10-1, 10-2 losses," Duclair said.

Stankoven got the Stars to within 6-4 at 12:58 of the third period. Following a turnover in the neutral zone, he skated into the left circle and scored with a shot that trickled past Kahkonen.

Johnston cut it to 6-5 at 13:41, banking in a shot from the left post. He then tied it 6-6 at 15:42 after he got to the rebound of Heiskanen's point shot, which had caromed off the end boards.

"I really liked what we did after we got up 6-3," San Jose coach David Quinn said. "We were staying above them and playing a good, smart third period. And then one mistake ends up in the back of our net and you could just feel the uh-oh feeling on the bench."

Duclair put San Jose ahead 1-0 with a power-play goal at 3:22 of the first period, scoring with a one-timer from the left circle off a pass from Zetterlund from behind the net.

Zetterlund increased the lead 2-0 at 12:04. Duclair chased down Jan Rutta's pass of the glass, spun and fed Zetterlund for a one-timer in front.

Benn cut it to 2-1 at 18:38 with a redirection of Heiskanen's point shot on the power play, and Stankoven tied it 2-2 at 19:27 with another power-play goal.

Ryan Carpenter responded for San Jose to make it 3-2 at 4:39 of the second period. Marc-Edouard Vlasic's initial shot was blocked, but Nico Sturm quickly passed the puck to Carpenter for a one-timer in the slot.

Johnston tied it 3-3 at 8:48, tapping in a backdoor pass from Benn on a rush.

Duclair scored his second power-play goal of the game to make it 4-3 at 15:48.

Filip Zadina then made it 5-3 at 17:50, finishing a backdoor pass from Mike Hoffman, and Granlund pushed it to 6-3 at 3:02 of the third period following a turnover by Thomas Harley behind the net.

"Going into the third 6-3, you just have to win that game," Duclair said. "That's just unacceptable. We just found a way to lose that game tonight."

NOTES: Wyatt Johnston (20 years, 296 days) is the youngest player in Stars/Minnesota North Stars history to get five points in a game. ... Stankoven has scored five goals and has eight points in his first six NHL games. ... Heiskanen's four assists were an NHL career high.