Mets reliever Edwin Diaz looks on from the mound after surrendering...

Mets reliever Edwin Diaz looks on from the mound after surrendering a two-run home run to the Nationals Victor Robles in the ninth inning of a game at Citi Field on Sunday. Credit: Jim McIsaac

Boy, would the Mets have liked to have taken a shot at Nationals closer Sean Doolittle down only one run in the ninth inning.

Edwin Diaz messed that up.

Boy, would the Mets have liked to have moved into at least a tie for one of the National League’s two wild-card spots.

Edwin Diaz (and two bullpen mates) messed that up, too.

The losing pitcher in Sunday’s 7-4 loss to the Nationals was Robert Gsellman. The go-ahead hit by former Met Asdrubal Cabrera was a two-run double against Justin Wilson.

But in the defeat that ended the Mets’ winning streak at eight games, their bigger concern was the two-out, two-run home run that former closer Diaz gave up to Victor Robles in the ninth.

That turned a one-run game into a three-run game. It took the air out of a lively crowd of exactly 41,000 at Citi Field.

Could the Mets come back from three runs down against Doolittle? They did it Friday night, scoring four in the ninth in perhaps their best win of the year. Then they pulled out another late-inning comeback win Saturday night. So sure, they could do it again. But you can’t count on miracles like that every day.

The Mets used Seth Lugo to pitch the final two innings of Saturday’s 4-3 victory. They left Diaz in the bullpen with a one-run lead going into the ninth. No one questioned the call.

Some may have questioned Mickey Callaway’s decision to bring in Diaz on Sunday. But Callaway already had used five relievers after Jacob deGrom lasted just five innings. You can hide Diaz for only so long.

Diaz, who hadn’t pitched since Monday, struck out Trea Turner before walking Adam Eaton. The crowd, which had given throaty approval to every Met in a lovefest that didn’t seem possible during the first half of the season, murmured uncomfortably. Anthony Rendon, 4-for-4, was next, and Diaz struck him out looking with a 97-mph fastball.

A 97-mph fastball is a pretty good pitch, but Diaz later said he had noticed Robles having trouble with sliders in the series. Didn’t Yogi Berra say you can’t think and hit at the same time? That’s probably true with pitching, too.

Three of the four pitches Diaz threw to Robles were sliders. The third slider stayed right in Robles’ happy zone and ended up over the leftfield wall.

It was the 11th homer allowed by Diaz in 45 innings. Last year with Seattle, he allowed five in 73 1⁄3. His ERA is 5.60. Last year, it was 1.96. The Seattle guy is the one Brodie Van Wagenen thought he was getting.

Robles’ home run made Doolittle’s task easier. The lefty retired the side in order for his second save in five chances against the Mets. They had peppered him for 16 hits and 10 runs in six innings, so it had to be a huge sigh of relief for the Nationals to leave town with at least some confidence in their closer.

The Mets got no such solace with Diaz. Van Wagenen flirted with flipping him at the trade deadline, but that never made much sense. They just have to fix him the same way they seem to have fixed Jeurys Familia, who threw a perfect, three-strikeout eighth and left to cheers.

The only Met who heard boos Sunday was Diaz. He certainly earned them. But Callaway insisted he isn’t going to drop him further in the pen pecking order.

“We really can’t afford to do that,” he said. “He’s going to continue to get big outs for us, continue to pitch in big games, and like we did last night, we’ll pick our spots.”

Callaway was talking about picking spots not to use Diaz, which is an interesting way to phrase it. It’s hard to imagine him getting the ball in a big situation anytime soon. But it’s also hard to imagine the Mets finishing their remarkable climb and earning a playoff spot if he doesn’t turn it around.

Eventually, they will need to use Diaz when it matters. Boy, do they have to hope he’s up to it.