Three Sundays ago, the Mets got on a plane to head home from San Francisco having lost three of four to the Giants.

What momentum came from the first two legs of that road trip — taking two of three at Miami before sweeping two at Minnesota — had been lost in the vestiges of those three losses to the Giants, all in extra innings. The bullpen seemed inadequate, a 7½-game wild-card deficit with eight teams to jump seemed insurmountable and a sell-off seemed inevitable. The end of the season, and manager Mickey Callaway’s fate, were barreling closer.

In the Mets clubhouse, that series instead gave a glimpse of what they could do.

“We probably could have won all four of those games [in San Francisco],” Todd Frazier told The Post before the Mets recorded their 12th win in 13 games in their 5-0 win over the Marlins on Tuesday night at Citi Field. “And then we came back home, we’re like, ‘All right, well, it’s either-put-up-or-shut-up time.’”

Before every game, the Mets’ hitters meet. That’s in part to scout the other team and plan out strategy. But before they do that, they discuss themselves — and what they’re capable of.

Since that series against the Giants, the Mets seemed to have found the answer to that question.

Questions about whether to trade Noah Syndergaard and Zack Wheeler were swapped for excitement over the rotation, which now runs five deep with the addition of Marcus Stroman. Questions about Callaway have subsided (for now). That 7½-game deficit has shrunk to 1½, and the Nationals are now looking over their shoulders with a series in Flushing looming this weekend. The Mets’ playoff odds entering Tuesday were 34.2 percent, per Fangraphs, high enough that belief was more than something to be ridiculed and platitudes about every game mattering had to be taken seriously.

“It starts with the pitching,” Frazier said. “We got five top-dog-caliber guys that any team would want. And they’re gonna put us in a good position every game. And it’s a matter of who’s gonna come up clutch. Who’s gonna be the hero today? It’s not about — who cares about the 0-for-4s? It’s a matter of winning.”

That message resonates loudest in the wake of losing Robinson Cano to a torn hamstring, one day after a three-home run barrage in the seventh inning carried the Mets to a come-from-behind win when a loss might have stopped their momentum.

Callaway proffered the theory that his team had stopped pressing, instead just letting things come to them, like a golfer whose drives go farther when he stops trying to kill the ball.

“I think that the process matters and the hardest thing, probably in life, is to stick with the process,” Callaway said. “You have to trust that you’re doing the right thing. You have to stay even-keeled as best you can. Obviously there’s always gonna be circumstances that are even tougher to deal with.”

The Mets — and Callaway in particular — have seen the worst of those circumstances. On more than one occasion this year, the ax seemed all but inevitable for the manager. On Tuesday, when asked why Michael Conforto and Amed Rosario were both sitting, Callaway provided a confident, smooth defense.

“There’s not gonna be much rest going on after this,” Callaway said. “So, this is kind of the last chance and then we’ll be getting after it.”

That statement would have been ridiculed three weeks ago. Now, it’s merely the reality of a playoff race.