Joel Ward's goal midway through the third period stood as the winner as the San Jose Sharks held on for a 5-4 victory over the hometown Calgary Flames on Monday night.

The Sharks broke a 3-3 tie with a Brent Burns power-play goal 5:12 of the third period and Ward scored five minutes later to give San Jose a two-goal cushion.

San Jose needed just 34 seconds on its only power play of the night to score on the NHL's worst penalty killing team. Burns snuck in from the blue-line uncovered and one-timed a feed from Joe Thornton. Burns then assisted on Ward's fluke goal, deflected in off the leg of Mark Giordano, at 10:21 to give him six goals and 11 points in his past seven games.

Thornton, Joonas Donskoi and Logan Couture, with his first of the season, also scored for San Jose (20-18-2), who opened the night two points back of Vancouver for third spot in the Pacific Division.

Sean Monahan, Dennis Wideman, Sam Bennett and Michael Ferland scored for Calgary (19-20-2). The Flames have lost four of their last five at home after a franchise-record 11-game winning streak at the Saddledome.

"We had way too many turnovers in the neutral zone and at the bluelines, and it seemed like the majority of them were ending up in the back of our net," said Flames centre Matt Stajan. "We've got to clean that up."

Sharks goaltender Martin Jones made 31 saves, including 15 in the third period.

"We've played well on the road," Jones said. "We've gotten some bounces and we've been able to score some timely goals. That's probably been the biggest thing."

Karri Ramo, making his 12th start in a row for Calgary, faced only 18 shots.

The Flames got within one goal at 16:19 of the third when Ferland scored with the goalie pulled to give the Flames a 6-on-4 but San Jose held off Calgary's last-ditch effort with the goalie pulled in the final seconds.

Trailing 3-1 in the second, Calgary tied the game when their league-worst power play produced two power-play goals just 15 seconds apart.

Wideman wristed a perfect shot inside the goal post on a two-man advantage at 11:12 before Bennett burst into the Sharks end, took a pass from Mikael Backlund and snapped a shot over Jones' glove for his first goal in 19 games.

Sharks defenceman Justin Braun was hit near the top of his visor by a Kris Russell slapshot early in the third period. Braun left a trail of blood as he was helped off the ice but he later returned to the game.