Jacob deGrom of the Mets pitches in the first inning...

Jacob deGrom of the Mets pitches in the first inning against the Marlins at Citi Field on Wednesday. Credit: Jim McIsaac

Before Monday’s series opener against the Marlins, Mets owner Fred Wilpon popped into the dugout during batting practice, looked up and exclaimed, “Where’s the rain?”

It was a rare sunny afternoon, and Wilpon was making a joke about how nice the weather finally was. After some showers on Tuesday, it was really nice on Wednesday, with a gametime temperature of 80 degrees for the rubber match at Citi Field.

You could say the same thing about the Mets. Even when things are going well — as they were for the first eight innings Wednesday — you look up and expect the sky to fall in.

The Mets hadn’t allowed a run and were all set to beat the Marlins Wednesday night when Jeurys Familia gave up the tying and go-ahead runs in the ninth inning to the majors’ lowest-scoring team.

When pinch hitter Wilmer Flores grounded to third with the potential tying run on second for the final out, the Mets had to swallow a 2-1 loss to end the homestand.

“You can’t expect to win games 1-0 all the time,” manager Mickey Callaway said.

The Mets were leading going into the ninth on the strength of seven shutout innings from Jacob deGrom and a fifth-inning homer by Brandon Nimmo.

Seth Lugo, who hasn’t allowed a run in his last 15 innings, gave up one hit in a scoreless eighth.

But in the ninth, Familia (2-2) gave up a one-out single to pinch hitter Martin Prado and a double to Derek Dietrich to put runners on second and third.

J.T. Realmuto singled to center to tie it, and Michael Conforto threw out Dietrich at the plate to keep it tied. Not for long, though, as former Yankee Starlin Castro lined the two-out, go-ahead single to left.

Familia was booed off the mound after recording the final out of the inning. It was his fourth blown save in 17 chances.

“We’re like a family in here,” Familia said. “Every time everybody has a game like that and then we come out from the bullpen and don’t do a good job, you feel bad as a teammate because we are like a family. It is what it is. It’s part of the game.”

The Mets tried to rally in the ninth. Adrian Gonzalez singled with one out, but closer Brad Ziegler retired Luis Guillorme and Flores for his ninth save.

Nimmo homered with one out in the fifth to the second deck in right off Dan Straily. It was Nimmo’s third home run of the season.

The Mets scored four runs in losing two of three in the series. They open a four-game series in Milwaukee on Thursday before four more in Atlanta, including a Memorial Day day-night doubleheader. The Brewers and Braves are first-place teams.

“Two good ballclubs,” deGrom said. “We know we’ve got a good team. We’ve just got to put some things together. Get everybody kind of going at the same time. There’s some guys struggling, but they’ll come out of it.”

DeGrom isn’t one of the strugglers. He followed up his 13-strikeout game against Arizona last Friday with another gem. DeGrom didn’t allow a hit until Justin Bour’s bunt single leading off the fourth. In all, deGrom gave up four hits, walked two, hit two batters and struck out eight. He threw a season-high 109 pitches.

DeGrom has a 1.54 ERA. The Mets are 5-5 in his starts.

“It’s tough because he’s been dominant,” Callaway said. “Not just good or solid, he’s been dominant. He’s not giving up any runs. We’re in a good spot to win the game every time he pitches.”

Said deGrom: “You know those guys are out there giving 100 percent and I’m comfortable with them coming in the game. It’s rare that that happens and tonight they got Familia there, but we’re back at ’em tomorrow.”