NEW YORK — While Clayton Kershaw redefined his postseason legacy Tuesday night, Kenley Jansen established his.

By registering the last four outs of a 3-1 victory over the New York Mets in Game 4 of a National League division series, Jansen did more than save a game for the Los Angeles Dodgers. He might have saved their season.

With their closer doing in October what he did in the regular season, the Dodgers avoided elimination at Citi Field and forced a winner-take-all fifth game Thursday in Los Angeles.

Game 2 winner Zack Greinke will start for the Dodgers. Game 1 winner Jacob deGrom will pitch for the Mets.

“We’re going home,” Jansen said. “We have momentum.”

Their season would be over if Jansen hadn’t finished what was started by Kershaw, who earned his second career postseason victory by limiting the Mets to one run over seven dominant innings on three-days’ rest.

“He came in with the mentality of, ‘I’ve got this,’” first baseman Adrian Gonzalez said.

The situation Jansen encountered was anything but comfortable. With the bullpen as unreliable as ever, Jansen was asked to enter the game earlier than usual.

Jansen had only one four-out save in the regular season. He had pitched only once in the last 10 days, when he closed out his team’s 5-2 victory in Game 2 of this series.

But when setup man Chris Hatcher walked Curtis Granderson with two outs in the eighth inning, Jansen was called to pitch to David Wright and preserve the Dodgers’ two-run advantage.

“I was ready for six outs,” Jansen said.

His predicament worsened when a 2-2 pitch to Wright was called a ball by home plate umpire Chris Guccione.

The Dodgers were convinced Wright tipped the ball into catcher A.J. Ellis’ glove with a checked swing for what would have been a third strike.

“I believe it was a clear foul tip,” Ellis said.

The next pitch was also a ball and, suddenly, the Mets had the trying run on base.

Jansen responded by forcing Daniel Murphy to fly out to right field. His final pitch to Murphy was his 19th pitch of the inning.

If Jansen was exhausted, he didn’t show it, as he struck out two batters in a perfect ninth inning.

“I just love it, man,” Jansen said. “I love being in that situation right there. That’s when you can prove how good you can be.”

Jansen closed out a NLDS against the Atlanta Braves two years ago. But he was limited to only one postseason game last year, as the Dodgers losing three of four games to the St. Louis Cardinals in a first-round series.

With Kershaw pitching on short rest Tuesday night, Manager Don Mattingly said he didn’t consider sending the three-time Cy Young Award winner back to the mound for the eighth inning. As soon as Hatcher entered the game, Jansen started warming up.

Hatcher and Jansen had a lead to protect, as the Dodgers managed to score three runs in the third inning against Mets rookie left-hander Steven Matz.

Sidelined for nearly three weeks with a sore back, Matz last pitched in a major league game on Sept. 24. His preparation for Game 4 included an 80-pitch simulated game last week.

Kershaw started the three-run surge with a one-out single to right field. Enrique Hernandez grounded into a force out, but went from first base to third on a hit by Howie Kendrick.

“I felt like I had a pretty good idea of what his pickoff move was and when he was going to the plate,” Hernandez said of Matz. “So once Howie got to two strikes, I was like, ‘I’m just going to go.’ If I get thrown out, whatever, we’ve got Howie leading off the next inning.”

With two out and runners on corners, Gonzalez stepped into the batter’s box.

Gonzalez dropped a broken-bat flare single into center field, scoring Hernandez from third for the first run of the game.

Gonzalez has driven in a run in each of the Dodgers’ four postseason games this season, the second-longest streak in franchise history. Manny Ramirez drove in runs in five consecutive playoff games in 2008.

Justin Turner followed with a double down the left-field line, driving in two more runs to increase the Dodgers’ advantage to 3-0. Gonzalez, who is known as one of the slower players on the team, scored from first base on the play.

“I’ve got a second gear,” Gonzalez joked. “I don’t have a third or fourth, but I have a second.”

Ellis singled in the following inning to extend his postseason hitting streak to 12 games, establishing a new Dodgers record.