SAN JOSE, Calif. - A matchup with their fiercest rival was all it took for the San Jose Sharks to get their intensity back.

Patrick Marleau and Joe Pavelski scored power-play goals to send the Sharks into the NHL All-Star break on a winning note with a 4-2 victory over the Los Angeles Kings on Wednesday night.

"We needed this game," Pavelski said. "We know it's going to be a competitive game when we play them and it needs to be that way. But it needs to be that way every night. Guys shored up and did that. We've got to bottle it every night, we've got to compete."

The Sharks had lacked that in recent games, losing back-to-back at home against Calgary and New Jersey. But they responded with a complete game against the Kings.

Logan Couture scored twice and Antti Niemi made 15 of his 26 saves in the third period.

"Right off the start, the competition level was there," Pavelski said. "When that's there and guys are engaged, all the small stuff seems to take care of itself.

Dustin Brown and Jeff Carter scored for the Kings, who have lost seven of eight, although four came after regulation. Jonathan Quick made 21 saves.

"We have to do a better job in certain areas," defenceman Robyn Regehr said. "We can't afford to give up two power-play goals and expect to win, especially on the road. We can all just do a better job."

With the teams locked in a one-goal game in the third period, Pavelski gave the Sharks some needed insurance after Drew Doughty negated a Los Angeles power play by high-sticking Couture.

The Sharks put pressure on Quick, who came out of his net to stop a shot by Marleau. Pavelski got to the rebound and knocked it in the open net for the 5,000th regular-season goal in San Jose history.

Carter scored a power-play goal with 22.4 seconds to play but Couture got credit for an empty-net goal when he was hooked by Doughty in the closing seconds to seal it.

The Sharks blew chances to build on a 1-0 lead when they failed to get shots off on a pair of 2-on-1 rushes, and Quick stopped Couture on a breakaway. That proved costly when the Kings got the equalizer midway through the second on a wraparound by Brown.

But Marleau answered when he redirected Couture's shot past Quick to give San Jose a 2-1 lead. It was just the second goal in 20 games for Marleau and his first on the power play since Nov. 8.

The Kings made their only trip of the regular season to the Shark Tank and first since completing the comeback from a 3-0 series deficit by winning Game 7 of the first round here last April.

That sent Los Angeles on its way to a second Stanley Cup title in three seasons and San Jose to a summer of soul-searching. Both teams have been inconsistent so far this season and fighting for playoff position in the tough Western Conference.

San Jose goes into the break in second place in the Pacific Division with 56 points. Los Angeles is in fifth with 52 and would be out of the playoffs if the season ended now.

"We're disappointed in where we are in the standings right now," centre Anze Kopitar said. "We have to take the next few days to figure that out. It's time to play desperate coming out of the break."

There was good energy from the start with fans starting the "Beat L.A.!" chants before the opening faceoff, and Los Angeles' Kyle Clifford getting into an early scrap with Brenden Dillon.

Shortly after that fight, Couture gave San Jose the lead when he skated past Alec Martinez and beat Quick with a shot to the short side for his 17th goal.

"We have to capture that and be prepared to bring it to the rink after the break every night because it's shaping up to be a very tight conference," coach Todd McLellan said.

NOTES: It was "Metallica Night" with members of the band on hand to drop the opening puck and take part in other events. ... Niemi got his second assist of the season and seventh in his career on Couture's goal. ... The teams will play once more in the Bay Area next month in an outdoor game at Levi's Stadium.