SAN JOSE, Calif. (AP) -- Coach Todd McLellan lit into the San Jose Sharks after a lackluster second period against a struggling team staggering to the finish of the season.
He got just the response he was looking for as the Sharks extended the NHL's longest current winning streak.
Dan Boyle tied the game early in the third period and Joe Pavelski provided the game-winner with 2:06 remaining to lead the Sharks to their second seven-game winning streak of the season with a 2-1 victory over the Calgary Flames on Friday night.
''We tried to cheat the game a little bit and it wasn't going to work that way,'' McLellan said. ''We talked about it. I was happy the way they responded. That's a good sign. It was a hard fought third just to come out with the points.''
Antti Niemi made 23 saves for the Sharks, including one in the closing seconds against Michael Cammalleri as San Jose matched its winning streak to open the season. San Jose remained perfect through six games of a seven-game homestand and has moved from ninth place to fourth in the Western Conference during this streak.
''I think we're just playing really aggressive, real hard,'' captain Joe Thornton said. ''Tonight wasn't too pretty, but I thought we carried the play for most of the game, but eventually we wore them down.''
Mikael Backlund scored and Miikka Kiprusoff made 39 saves for the Flames, who have lost 12 straight road games.
The Flames are reeling, having traded two of their top players before this week's deadline with captain Jarome Iginla going to Pittsburgh and defenseman Jay Bouwmeester being sent to St. Louis. But they still nearly ended the longest current winning streak in the NHL.
''I was proud of the way guys stepped up,'' coach Bob Hartley said. ''Everyone worked hard. It's too bad they got the winning goal in the end. I thought we deserved better. But we turned the puck over, and the puck goes in the net.''
Calgary took a 1-0 lead into the third period and even killed off an early power play before allowing the tying goal. Logan Couture, who hit the crossbar earlier on the shift, fed Boyle whose shot deflected off defenseman Dennis Wideman and into the net for his seventh goal of the season. It was just the second at even strength.
Thornton nearly broke the tie for San Jose late in the period but was robbed by the crossbar. But Kiprusoff had no chance on Pavelski's game-winner. Kiprusoff stopped TJ Galiardi's original shot, but Brent Burns poked the rebound loose. Pavelski came from behind the net to knock the puck in to give the Sharks their third win this season when trailing after two periods.
''Galli did a lot of good work early on. He gets it to the net,'' Pavelski said. ''Burnsie's coming down. He's a huge body. He just creates a lot of traffic. Everyone kind of goes in, the puck squirts out and got an empty net there. It's a great goal. It's one that you love to get, and obviously it was timely.''
The Sharks controlled the play for most of the first period but were still trailing 1-0 after 20 minutes because they couldn't get anything past Kiprusoff despite 17 shots.
Kiprusoff made a nice stop on Couture early off a nice passing sequence from Tommy Wingels to Patrick Marleau, robbed Pavelski with a glove save and helped kill off an early power play.
The Flames then took just 6 seconds to score on their first man advantage when Couture was called for hooking. Backlund won a faceoff from Marleau back to Cammalleri. Backlund took a return pass and beat Niemi with a shot from the top of the circle for the first power-play goal against San Jose in seven games.
Neither team scored in the second with both goalies turning aside eight shots and both teams failing to convert on a power play.
''They did a good job creating offense like they usually do and ultimately cashed in on it,'' Cammalleri said. ''We have to work more on playing in their end instead of ours.''
NOTES: Newly acquired Sharks Raffi Torres and Scott Hannan didn't play. Hannan is working his way back from a neck injury, and Torres didn't feel well but could play Sunday. ... San Jose D Jason Demers also could be back from a head injury on Sunday. ... Calgary D Mark Giordano didn't make the trip so he could be with his wife, who was due to give birth. Brett Carson played in his place for his first game of the season.