Tanner Pearson scored at 3:10 of overtime, beating Antti Raanta from the right circle, as the Los Angeles Kings rallied for a 5-4 win on Friday night at the Garden to snap the Rangers’ 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 in his return to the crease for the first time in three weeks.

“I was very nervous the first couple periods,” said Raanta, who hasn’t won since Nov. 15 (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 on to their 4-3 lead after scoring 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. But it was not to be.

advertisement | advertise on newsday

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

“The last four minutes felt like forever,” said Raanta, who fell to 4-5-1 after winning his first four starts. “It’s pretty funny how much bad luck, right now, I have. I wanted to win so bad, it’s really tough to take . . . I don’t know what’s wrong right now. I feel like I’m there but the reaction isn’t. When you don’t have the feeling in your head and your body, it’s pretty hard.”

The Kings opened a 2-0 lead in the first 11:26, but Viktor Stalberg scored at 13:30 to close the gap.

The Rangers scored twice to take a 3-2 lead in the second period. Derek Stepan came off the left wall and shot five-hole at 9:21, and Zuccarello scored on a backhander that bounced off Vinny Lecavalier’s leg 37 seconds later.

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 one start in 23 games, had no chance on Kopitar’s second goal of the game.

“It’s 3-3 and touch-and-go,’’ Marc Staal said. “It’s great when you win and it’s a heartbreak when you lose. We do get a point against a good team that’s been playing well.”

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

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

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

Just 33 seconds into the game, on the first shot, the Kings took a 1-0 lead.

advertisement | advertise on newsday

Without a forward in sight, Kopitar took a pass near the right circle and Staal froze. Kopitar picked a spot — high glove side — and zipped it past Raanta.