NEW YORK — J.T. Miller was in the perfect spot in front of the goal to take advantage of a rebound in overtime and keep the New York Rangers perfect in four regular-season outdoor games.

Miller scored a power-play goal 2:43 into the extra period to lift the Rangers to a 3-2 victory over the Buffalo Sabres on Monday at Citi Field in the NHL’s 10th Winter Classic.

The Rangers went on the power play 2:15 into overtime when Jacob Josefson was whistled for tripping Jimmy Vesey. Kevin Shattenkirk fired a shot that rebounded right to Miller, who put it in.

“Fortunate to get a good shot to the net,” Miller said. “Not too often they come right on the stick like that.”

Paul Carey and Michael Grabner scored in the first period for the Rangers. Henrik Lundqvist stopped 31 shots to help New York improve to 6-2-3 in its last 11 overall.

“We talked about going into this game, there’s no way you’re going to look back at this as a great memory if you don’t win,” said Lundqvist, who is 4-0-0 with a 1.98 goals-against average outdoors.

“Now we got a big win and we can always look back at this game as a great experience.”

Rasmus Ristolainen had a goal and an assist, Sam Reinhart also scored and Kyle Okposo had two assists for the Sabres. Robin Lehner finished with 39 saves for Buffalo, which has just 10 wins this season but is 4-3-5 in its last 12 games.

“The first 10 minutes were not very good, we were kind of dipping our toe in,” Okposo said. “Once we calmed down and played our game, we played well. So I’m proud of the guys, proud of the way we played.”

The game, played at the home of baseball’s New York Mets, was on the 10th anniversary of the Sabres’ 2-1 shootout loss to Pittsburgh in Buffalo in the first Winter Classic. This was the league’s 24th regular-season outdoor game.

Lundqvist made a sensational save on an attempt by Zemgus Girgensons with 2:12 remaining to keep the score tied.

“It was a fun game to play,” Lundqvist said. “Overall, I thought we were the better team, but we took a lot of penalties that put us on our heels a little bit.”

Despite an official temperature of 20.5 degrees, the game drew a sellout crowd of 41,821.

“It was loud, the crowd was behind both teams,” Rangers captain Ryan McDonagh said. “It was great for us to find a way to come through in overtime.”

The Sabres trailed 2-0 after one period before Reinhart cut the deficit in half 56 seconds into the second period on a rebound of Ristolainen’s shot.

Buffalo tied it 27 seconds into the third when Ristolainen fired a wrist shot off a pass from Ryan O’Reilly.