J.D. Davis was hoping to keep the jersey from his first career walk-off.

Its whereabouts, and condition, by the end of Wednesday night were questionable.

But the Mets’ magic was not, after Davis sent Citi Field into hysteria again with a walk-off single in the 10th inning to beat the Indians, 4-3.

Davis worked a nine-pitch at-bat against closer Brad Hand with two outs in the bottom of the 10th inning and delivered a line drive that one-hopped the left-field wall to score Michael Conforto and set off a celebration. Davis ran into center field, where Pete Alonso ripped off his jersey — just as he did to Conforto after his walk-off during the last homestand.

“You hit a walk-off, your shirt’s coming off,” Alonso said.

On a night Marcus Stroman made an early exit with hamstring tightness, the Mets (66-60) sent the roaring crowd home happy with their fourth straight win while clinching another series victory — their 10th in 12 series since the All-Star break. They gained half a game in the NL wild-card standings, finishing the night 1 ¹/₂ games back of the Cardinals for the final spot.

“It’s unbelievable right now,” the red-hot Davis said. “I’ve been saying it for a while now that this is a special team. We knew it from the beginning of spring training, it was just a matter of time until we hit on all cylinders where our pitching, bullpen, hitting, timely hitting all came together. We’re doing it.”

The Indians (74-53) broke the 2-2 tie in the top of the 10th when Carlos Santana hit a two-out, two-strike home run off Luis Avilan, but the Mets answered right back. As their schedule has toughened up, so have the Mets as the race to October continued.

“These guys believe in themselves,” manager Mickey Callaway said. “Especially when they’re down, they feel like they’re going to come back.”

Amed Rosario led off the bottom of the 10th with a double to right-center field and advanced to third on a sacrifice bunt by Joe Panik. The Indians intentionally walked Alonso to get a lefty-on-lefty matchup between Hand and Conforto.

Conforto hit a grounder to first base and Santana threw to second to start a potential game-ending double play. But nobody covered first base for the return throw that never happened, allowing Rosario to score to retie the game, 3-3.

Wilson Ramos then hit a dribbler down the third-base line and beat it out for an infield single, extending the inning for Davis’ heroics.

After Seth Lugo threw a pair of scoreless frames, Avilan got the 10th. Callaway chose the lefty, not Edwin Diaz, to face the top of the Indians’ order, which featured three straight switch hitters. Avilan got two outs before Santana homered with Diaz warming up in the bullpen.

Stroman left the game after four innings of one-run baseball because of left hamstring tightness. It stemmed from the last out he recorded, a groundout on which he had to run to cover first base, though he did not outwardly show any signs of injury. Jeurys Familia replaced him to start the fifth inning as Stroman went for an MRI exam.

“We’re not concerned at this point,” Callaway said.

Juan Lagares (2-for-3, walk) and pinch-hitter Luis Guillorme hit back-to-back doubles to give the Mets a 2-1 lead in the fifth inning. Brad Brach gave it right back on Jose Ramirez’s RBI triple in the sixth, but he escaped further damage.

It just helped set up another night to remember at Citi Field.

“Our crowd makes that atmosphere and it’s electric,” Callaway said. “Hey, if we get to where we want to go, we’re going to have plenty of experience in front of big crowds and big situations.”