Mets reliever Luke Weaver walks back to the dugout after...

Mets reliever Luke Weaver walks back to the dugout after the Yankees' Anthony Volpe grounded out in the 7th inning with the bases loaded at Citi Field on Saturday. Credit: Jim McIsaac

Luke Weaver has known Clay Holmes for years. They have a friendship forged in the Yankees’ clubhouse and often are seen chatting with each other in their new Flushing home. But Weaver wasn’t thinking about his fallen comrade when he was on the mound Saturday night.

“Clay would probably be disappointed that I wasn’t thinking about him there on the mound, but the situation presented itself pretty quickly,” he said. And make no mistake, “it was stressful.”

Weaver, who came in with the bases loaded and none out in the seventh, stranded the three runners, and Mark Vientos had three RBIs as the Mets beat the Yankees, 6-3, at Citi Field on Saturday night.

Weaver further saved an already taxed relief corps at the tail end of a bullpen game, pitching a scoreless eighth — an inning in which he helped turn a double play and got Aaron Judge to fly out to center for the final out. Devin Williams pitched a perfect ninth for his sixth save and his first at home.

“You try to pick each other up, try to show each other,” Weaver said hours after Holmes, the staff ace, went down with a fractured right fibula that will cost him months of the season — an injury that cast a significant pallor over an already dark few months.

“I wanted people to know, especially my teammates, that’s what we’re capable of,’’ he added. “We could beat great teams in this league and it just takes some fundamental baseball. It takes big moments, it takes some mistakes that we bounce back from and ultimately, you’re just trying to get on the right side of it.”

It marked the first time since the first week of the season that the Mets have defeated a team that currently is over .500.

The Mets (19-26) were up 5-2 when Judge led off the seventh with a double off Brooks Raley. Cody Bellinger hit a lazy pop-up to right that Carson Benge appeared to lose in the lights, allowing Judge to score and landing Bellinger on second. Paul Goldschmidt was hit by a pitch and Jazz Chisholm Jr. bunted over Raley’s head to load the bases with none out.

Weaver then put together what might be the relief performance of the season: He set up Amed Rosario with a 97.6-mph fastball before striking him out on a foul tip off an 88.9-mph changeup, struck out Trent Grisham swinging on a changeup out of the zone and got Anthony Volpe to hit into a forceout.

Weaver hasn’t allowed a run in six appearances this month.

“That was sick,” Vientos said. “That was fun to be a part of. I think just seeing him on the mound and getting his mojo is just fun to watch. He’s just in a different mode, a different person on the mound.”

The Yankees (28-18) opened the scoring on Grisham’s RBI single against David Peterson in the second, but the Mets were able to scrounge their first lead of the series in the most unorthodox of manners — two errant tosses by Carlos Rodon on the same play.

In the bottom of the third, Benge turned on Rodon’s 2-and-2 slider and drove it to right for a two-out double. Rodon issued back-to-back walks to Bo Bichette and Juan Soto and, with Vientos at the plate, sailed a fastball high over Austin Wells’ head for a run-scoring wild pitch. The ball ricocheted off the backstop and sailed to a scrambling Rodon, who barehanded it and sailed his throw home far wide, allowing Bichette to slide in safely and give the Mets a 2-1 lead.

They added a run in the fourth when Austin Slater drew a two-out walk and Brett Baty doubled to right to knock out Rodon.

The Yankees drew within a run in the fifth when with runners at the corners and two outs, Goldschmidt grounded a single through the right side of the infield. Peterson struck out Chisholm swinging on a sinker above the zone to strand the tying run in scoring position.

Benge led off the bottom of the fifth with a single and Soto walked with one out to bring up Vientos, who lined Brent Headrick’s splitter past a diving Rosario and into the leftfield corner to drive in two runs and give the Mets a 5-2 lead.

Then came the seventh.

“Weave was unbelievable,” Carlos Mendoza said. “I’ve seen that before, but he was fired up.”

Mendoza was far more upbeat than he had been hours earlier, when he noted that Holmes’ injury “felt different” from the other woes that have befallen this team.

“I think it means a lot to everyone in here,” Mendoza said. “Last night was tough for all of us in there in the clubhouse ... but the reality is that we still have a job to do and we have 26 big-league players who are more than capable to turn this thing around even though we’ve been facing a lot of adversity.”

Weaver, for one, was happy to pick up his friend and teammate ... once he remembered that that’s what he was doing.

“Just a real gut punch,” he said of Holmes’ injury. “But it’s games like tonight where you know every day has an opportunity just to try and hit the refresh button and kind of make the most of it, so that’s how I look at it. When I saw [Holmes], I was just like, ‘That was in honor of you. I even had your name written in my hat.’

“Which I didn’t, but it felt right to say.”

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME