Mets players mob Jose Bautista at home plate after his...

Mets players mob Jose Bautista at home plate after his walk-off grand slam against the Tampa Bay Rays for a 5-1 win in an MLB baseball game at Citi Field on Friday. Credit: Kathleen Malone-Van Dyke

It happened.

It finally happened.

No, the Mets didn’t finally manage to get Jacob deGrom a well-earned victory. But they did win a game at home for only the third time in 18 tries. And Jose Bautista, who had the most homers among active players without a walk-off, finally checked that off his baseball bucket list.

Hey, you can’t win ’em all, but the Mets certainly will take that one.

Bautista hit a grand slam with two outs in the ninth inning Friday night as the Mets capped a frustrating night with some full-on euphoria in a 5-1 win over the Rays at Citi Field.

Todd Frazier drew a leadoff walk in the ninth against Chaz Roe. Devin Mesoraco singled and Amed Rosario sacrificed them to second and third. After Dominic Smith was retired on a comebacker for the second out, Brandon Nimmo was intentionally walked to load the bases.

“I was looking for a good pitch and I got it,” Bautista said. “I’m glad I didn’t miss it . . . I was aware [of not having a walk-off]. I guess sometimes it takes longer.”

Before that, it appeared to be more of the same, and the same hasn’t been all that great. DeGrom was brilliant through eight innings, allowing one earned run and four hits in 105 pitches, with a walk, eight strikeouts and one hit batsman — the latest in a long string of brilliant performances that have gone for naught. His ERA dropped to 1.79, best among starting pitchers in the majors. But he is 5-4, and the Mets have lost seven of his nine no-decisions.

The Rays’ only run came with deGrom nursing a one-run lead in the fifth, when Willy Adames hit a letter-high fastball to center for a home run that tied it at 1.

After that, deGrom continued to cruise, and the Mets continued to do what they’ve done — that is, not support him all that much. With Wilmer Flores at first and one out in the sixth, Frazier hit a long double to left, and Flores attempted to score as third-base coach Glenn Sherlock windmilled his arms from his box in foul territory. Flores was out by a few steps, not even attempting a slide.

The Rays loaded the bases against Jeurys Familia with one out in the ninth, but Mallex Smith hit a grounder to Flores at first; Flores made a high throw to Mesoraco, but he corralled it to get the out at home and preserve the tie.

“The goal is to win,” deGrom said. “Whether I get the win or someone else does, the goal is to win baseball games.”

Newsday LogoYour Island. Your Community. Your News.Digital AccessOnly 25¢for 5 months