CALGARY — It took Evander Kane until his 565th game to record his first career NHL hat trick.

He then added another goal for good measure to lead the San Jose Sharks to a 7-4 win over the Calgary Flames on Friday.

"It's nice to get that monkey off my back," said Kane, who the Sharks acquired from the Buffalo Sabres on Feb. 26 for forward Daniel O'Regan and conditional first- and fourth-round picks in the 2019 NHL Draft. "It's been a long time since I've scored a hat trick. That was great. It made it even better, obviously, in a big game, an important game."

Forward Joe Pavelski, who set up Kane's fourth goal 62 seconds into the third period, was happy to see his new teammate come through in the clutch.

"It's always a special night when someone can score three, and for him to get that fourth is pretty cool to see," Pavelski said. "He's definitely made a huge impact on us as a team and on his teammates. He's been one of the guys driving the bus here for the last week or two. He came through big for us tonight."

Tomas Hertl had a goal and an assist for the Sharks (39-23-9), who have won three straight games and four of their past five.

Kevin Lebanc and Eric Fehr also scored, while goalie Martin Jones made 30 saves to improve his record to 25-18-6.

Micheal Ferland had a goal and an assist for the Flames (35-27-10), who are four points behind the Dallas Stars (38-26-8) for the second and final wild-card spot in the Western Conference.

"We had a few leads in the second (period) and those are times when you want to put your foot on the pedal and get the next one," said veteran forward Mark Stajan, who's three games away from reaching 1,000 for his career. "We weren't able to do that."

Troy Brouwer, Mark Jankowski and Johnny Gaudreau also scored for Calgary.

Three nights after stopping all 28 shots he faced against the Oilers, Calgary goalie Mike Smith had a rough outing as he made just 14 saves before being replaced by David Rittich early in the third period. Rittich went on to stop all seven shots he faced in a relief appearance.

"Terrible," said Smith when asked to describe his performance. "It was one of those nights where pucks were hitting things, going in. A couple bad breaks there. It was definitely an off night and a tough one to swallow right now."

The Sharks opened the scoring six minutes into the first period when Kane's wrist shot from just inside beat Smith to the glove side.

The Flames pulled even at 16:42 when Brouwer chipped a pass from Curtis Lazar into the top corner behind Jones.

Jankowski took a pass from linemate Garnet Hathaway and wired a shot to the top corner, glove side behind Jones to put Calgary up 2-1 at 2:10 of the second period.

Kane then redirected Brenden Dillon's point shot past Smith at 6:29 before Gaudreau cut into the slot and snapping a shot past Jones at 10:16 to put Calgary back up by a goal.

That lead lasted just 1:26 as Lebanc fired a shot from a sharp angle into the top corner past Smith to pull the Sharks into a 3-3 tie.

Kane completed his hat trick at 16:32 when he swatted in his own rebound before Hertl poked the puck through Smith's legs with 1:58 remaining before the second intermission.

"I thought we had some good energy, especially after Johnny scored there," said Calgary captain Mark Giordano, who was disappointed the Flames weren't able to hold onto the lead. "We didn't do a good job of stopping them. They came in pretty easy there and got the puck in our net."

Ferland backhanded a shot past Jones to pull Calgary within two goals with 5:35 left in regulation and Rittich on the bench for an extra attacker before Fehr rounded out the scoring with an empty-net goal 1:37 later.

Notes: Jankowski suited up for the Flames after sitting out Tuesday's 1-0 win over the Edmonton Oilers, while fellow forward Kris Versteeg made his return to Calgary's lineup after missing the past 49 games with a hip injury. … Gaudreau extended his point scoring streak to six games, during which time he has scored three goals and added five assists.