Weary and banged-up, a bulky ice pack wrapped around his aching left knee, Asdrubal Cabrera sat in a chair in front of his locker, the quintessential figure in a season of pain.

He shouldn’t have played on Tuesday night, and he knew it, too. But like the rest of the Mets, Cabrera has braced his battered body with a newfound stubbornness, one that is growing by the day.

“I want to be there for the team,” Cabrera said, after he helped the Mets beat the Marlins, 7-4, to inch forward in what remains an arduous wild-card race.

Off the bench, Curtis Granderson slammed a pair of homers. On the mound, 34th rounder Seth Lugo delivered a quality start to extend his improbable resurgence in the rotation. And at the plate, Cabrera smashed a game-tying two-run homer in the first that changed the tenor of the game.

“As a teammate, we appreciate that from him,” said Jose Reyes, who collected four hits and scored twice. “That means he wants to win too, like us. He doesn’t feel too good but he finds a way to stay on the field. So, that’s good to see.”

Held together by little more than athletic tape, the improvised Mets continued their improbable ascent, winning eight of their last 10 games to pull past the Marlins and remain 2 1⁄2 games behind the Cardinals, who own the final wild card.

advertisement | advertise on newsday

Earlier in the day, more casualties mounted. It is questionable whether second baseman Neil Walker plays another inning at second base because of a bad back, or whether lefty Steven Matz pitches another inning because of a tight shoulder. But the Mets were undaunted.

Granderson’s two homers came even though he didn’t enter the game until the sixth inning as a pinch-hitter. Meanwhile, Lugo overcame early trouble, then turned away rallies on the way to holding the Marlins to two runs on five hits in six innings.

Unheralded, and pressed into service only because injuries and fatigue have blitzed the rotation, Lugo is 2-1 and has allowed just five runs in 17 2/3 innings as a starter.

“Our young guys have stepped up,” said manager Terry Collins, who sent rookies to the mound in three straight days and won twice.

Scuffling with injury woes of their own, the Marlins hadn’t homered in seven straight games before Christian Yelich ended the drought with a two-run shot in the first inning.

Mets videos

Lugo hadn’t allowed a homer in his first 31 1/3 innings as a major leaguer. But the Mets answered with three runs in the first, two of them because of Cabrera.

Under any other circumstance, the shortstop would be resting his aching left knee, which already has sent him to the disabled list once only to flare up yet again. But if the Mets are to sneak in through the side door and crash the postseason, they’ll need to will away their pain, and hope that things start bouncing their way.

“I don’t think so,” Cabrera said flatly, when asked if he’d be playing had the stakes not been so high. “But we’re in this situation right now.”

There was no hiding the bad knee.

In the sixth, Cabrera couldn’t turn on the jets when third base coach Tim Teufel inexplicably sent him home on an Alejandro De Aza single to rightfielder Jeff Francouer, who still owns a cannon for a throwing arm. Cabrera was tagged out. Later, he left the game when he came down hard, leaping after a line drive.

advertisement | advertise on newsday

Nevertheless, Cabrera left his mark. Playing through a thumb injury in the playoffs last year, Granderson remembered how simply trying to stay in one piece had eased the pressure to perform.

Said Granderson: “It also helps in that situation sometimes because you’re so worried about ‘OK, let me not get injured’ that the baseball side takes over.”

Cabrera seems to have found that happy medium. He’s hitting .447 since coming off the disabled list earlier this month and he’s coming off NL player of the week honors.

And his knee didn’t bother him in the first, when he hobbled around the bases on a two-run homer that tied the game ahead of Wilmer Flores’ go-ahead RBI single. It was Cabrera’s 17th homer, the most he’s had in a season since hitting 25 dingers in 2011 with the Indians.

“When I’m on the field, I’m not thinking much about it,” Cabrera said. “I know I’ve got to be smart. I’ve got a bad knee. But I just try to play my game.”