NEW YORK — Just when things are starting to fall in place for the surging New York Mets, another key injury clouded what should have been a jubilant clubhouse after one of their biggest wins this year.

After Kelly Johnson’s three-run double in the eighth inning broke a tie and lifted the Mets to a 5-2 win over the Miami Marlins on Wednesday night, manager Terry Collins announced that second baseman Neil Walker would probably have season-ending surgery on a herniated disc in his back.

“After all the evidence has been gathered, he thinks that’s where he’s probably headed,” Collins said.

Walker is expected to discuss his condition Thursday.

Already without Matt Harvey (thoracic outlet syndrome) for the remainder of the year and with lingering injuries to Noah Syndergaard (bone spur), Steven Matz (shoulder/elbow), Asdrubal Cabrera (knee) and Yoenis Cespedes (quad), the loss of Walker comes at an inopportune moment. The Mets have won 10 of their last 13 to climb back into the National League wild-card race.

“This year, Walker has been a big part of this team, it’s a shame,” infielder Wilmer Flores said. “We’ve had a lot of injuries but we have to keep playing with what we have.”

Cespedes singled off A.J. Ramos (1-2) to start the winning rally. Curtis Granderson walked. Flores flew out to center, advancing a hustling Cespedes to third. After Jay Bruce flew out to right, Travis d’Arnaud walked to load the bases, bringing up Johnson.

Johnson, who was 25-for-79 with the bases loaded in his career with 74 RBIs, drove the ball into the right field corner. He emphatically clapped his hands and swung his arms into the air after reaching second base.

“I can’t explain the importance of having a veteran player who has been through many, many different situations, who can come off the bench and be a big hitter in big situations,” Collins said.

The victory gave New York a 15-14 record in August, their first winning month since April. They’ve moved to within 1 1/2 games of St. Louis for the NL’s second wild card.

Addison Reed (4-2) pitched a perfect eighth inning for the win. Jeurys Familia closed for his 44th save, a franchise record.

Ramos also blew the save in Monday’s series opener.

“I threw a slider that I was trying to make it around the zone and he took advantage of it,” he said. “He did what he’s supposed to do with that in a big situation.”

Christian Yelich homered for Miami, which dropped its fifth consecutive game.

New York had plenty of opportunities against starter Jake Esch, who was making his major league debut. After a pair of strikeouts in the first inning, Esch allowed four consecutive runners in the second, including Flores’ 15th home run. He pitched himself of out trouble in the fourth by inducing a double play from Mets’ starter Bartolo Colon.

The Marlins caught a break when 42-year old Ichiro Suzuki leaped above the center-field wall to take a potential two-run homer away from Curtis Granderson in the fifth.

With New York already leading 2-1 and runners on first and second, All-Star Marcell Ozuna made a diving catch on Flores’ sinking line drive to end the third inning. After initially stepping to his left, Ozuna quickly changed direction, ranging to his right and made a nifty grab before tumbling over. He rolled over several times before coming to a stop.

Ozuna was removed from the game in the next inning. X-rays were negative and is day-to-day.

TRAINER’S ROOM:

Marlins: RHP David Phelps, originally scheduled to start Wednesday’s game, was placed on the 15-day DL with a strained oblique. He hurt himself on his first swing during pitcher’s batting practice Tuesday.

UP NEXT:

Mets: RHP Jacob deGrom (7-7, 2.96 ERA) pitches the series finale; deGrom (rest) was scheduled to pitch in Friday’s opener against Washington after a nine-day layoff, but was moved up a day with Matz not yet ready to come off of the disabled list.

Marlins: RHP Jose Urena (2-5, 5.83 ERA) opposes deGrom. He’s lost four of six starts since moving to the Marlins’ rotation on July 19.

MAKING MOVES:

The Mets announced some moves after the game. First, they acquired 31-year old reliever Fernando Salas from the Anaheim Angels for pitcher Erik Manoah. Salas was 3-6 with a 4.47 ERA with the Angels but has four saves and a 2.93 ERA since the All-Star Game. Manoah was 5-5 with Class-A Brooklyn. OF Justin Ruggiano was moved to the 60-day DL to make room. The team also traded minor league catcher Nevin Ashley to Texas for cash.