LOS ANGELES — Tyler Toffoli and Austin Wagner scored 39 seconds apart in the second period to give Los Angeles the lead, and the Kings went on to beat the Calgary Flames 5-3 on Wednesday night.

Kurtis MacDermid, Jeff Carter and Sean Walker also scored to help the Kings end a five-game losing streak. Calvin Petersen stopped 35 shots to get his first win of the season in his second start.

Elias Lindholm had two goals and Mikael Backlund also scored for Calgary. Johnny Gaudreau had two assists and David Rittich finished with 28 saves in the Flames' fourth loss in six games.

Toffoli tied the score 1-1 off a rebound for his 15th of the season just 44 seconds after Backlund had put the Flames ahead.

Wagner then gave Los Angeles the lead for good with his fourth on a breakaway with 7 minutes to go in the middle period.

“It was nice to score,” said Wagner, a Calgary native who hadn’t scored a goal in two months. “I’ve had lots of chances, just haven’t gotten the bounce I need. ... Nice to finally see one go in. I think I’ve just been trying so hard lately. Think I’ve been gripping my stick a little too tight. On that one, I just kind of relaxed.”

MacDermid scored on a wrister that beat Rittich top shelf to extend the Kings lead to 3-1 at 1:42 of the third. It was the defenceman's third.

Lindholm scored at 3:25 to pull the Flames within one goal.

“I think they’re pretty tight in the middle,” Lindholm said. “We have a hard time sometimes to get the puck in and get to work down low. Next time we play them we have to be better.”

The Kings had a key penalty kill midway through the final period, with Calgary on a 5-on-3 power play for 1:03 thanks to back-to-back tripping penalties by Drew Doughty and Iafallo.

“That was huge,” MacDermid said. “That’s a strength of ours. When we get it done, that’s a huge momentum swing.”

Carter then scored from the slot for his 17th to give the Kings a two-goal lead again with 4:48 remaining.

With Rittich pulled for an extra skater, Lindholm got his second of the night and 24th of the season to pull Calgary to 4-3 with 3:05 remaining.

Walker's empty-netter with 3 seconds left sealed Los Angeles' win.

Backlund scored to put Calgary on the board first in the second period after a mistake by Petersen. The goalie went behind the net to play the puck, but the it took an unexpected bounce and in trying to clear it, the puck went right to Keith Tkachuck, who passed to Backlund for the goal.

The Kings — last in the Pacific Division — played a strong first period and outshot the Flames 13-8 in a scoreless first period.

NOTES: It was Dodgers night at Staples Center with retired second baseman Chase Utley dropping the ceremonial puck before the game. ... Calgary dropped to 12-4-1 in its last 17 road games. ... RW Martin Frk, just recalled from Ontario of the AHL, played in his fifth game with the Kings this season and almost scored with Rittich making a glove save.

UP NEXT

Flames: At Anaheim on Thursday night.

Kings: At Colorado on Saturday night.