Tanner Pearson scored at 3:10 of overtime, beating Antti Raanta from the right circle as the Los Angeles Kings rallied on Friday at the Garden for a 5-4 win to snap the Blueshirts’ winning streak at four games.

Anze Kopitar’s third goal of the night sent the game into overtime when his shot, going wide, bounced off Rangers defenseman Kevin Klein and caromed in with 29.7 seconds left in regulation to tie the score at 4.

It wasn’t the result Raanta wanted for his return to the crease for the first time in three weeks.

“I was very nervous the first couple periods,” said Raanta, who hadn’t won since Nov. 15 before he was struck in the mask by a shot against Minnesota on Dec. 17 and missed three games. “I was moving too much, I wasn’t set any time the shot was coming, it was more about just going down and hopefully it hits you . . . We got what I thought was the game-winning goal and they got the lucky bounce (off Klein) and it went in.”

It had appeared the Rangers would hold onto their 4-3 lead after they scored their first power play goal in the last six games. Mats Zuccarello, who had scored earlier, came down the right wall and found Kevin Hayes in front and the big center beat Peter Budaj at 15:14 of the third. It was Hayes’ ninth of the season — and second in two games. But it was not to be.

In a battle of the backup goaltenders, the veteran Budaj, who was making his Kings debut with No. 1 Jonathan Quick injured, outlasted the little-used Raanta, who had last played on Jan. 17, a 5-2 loss in Washington,

The Kings, who had opened a 2-0 lead in the first 11:26, continued to use their size and strength advantage in the third. But defenseman Alec Martinez, with a delay of game penalty, gave the Rangers the power play at 13:30 that led to the go ahead goal.

With the Rangers trailing 2-0 in the first period, Viktor Stalberg scored to close the gap. The Rangers scored twice to take a 3-2 lead in the second, with goals from Derek Stepan, coming off the left wall and shooting five-hole at 9:21, and Zuccarello, a backhander that bounced off Vinny Lecavalier’s leg 37 seconds later.

But Kopitar’s gift-wrapped redirection of Milan Lucic’s pass at the left post tied the score at 3 at 15:46. Raanta, who had 12 previous appearances but one start in 23 games, had no chance on Kopitar’s second goal of the game that made it 3-3 after two periods.

Early in the second, after a crazy sequence in front of the Rangers net, Chris Kreider’s dash resulted in a wrister off the goal post from 20 feet away.

At 10:12 of the period, the Rangers had to fight to hold the lead when Dom Moore called for hooking Kopitar in center ice, but they killed the minor penalty.

Dan Girardi blocked Jordan Nolan’s shot with 1:07 left, and was on his knees in pain for a minute, but skated out for the third.

Just 33 seconds into the game, on the first shot, the Kings took a 1-0 lead. Without a forward in sight, Kopitar took a pass near the right circle and Marc Staal froze. Kopitar picked a spot — high glove side — and zipped it past Raanta.