No one could have faulted the Mets for feeling a bit sorry for themselves last night. News had just broken that Yoenis Cespedes wanted to end his career with the team in the visiting dugout, and his quotes made it seem as if he preferred the A’s Bob Melvin to his own manager.

Steven Matz, who appeared in line for his third straight loss, was reminding them of this season’s lost promise, unable to fully bounce back from the worst start of his career. Then there was the fact that they were losing to one of the worst teams in baseball.

It was, in all, a microcosm of this season — a live action lesson in humility for these Mets. But it included something that the Mets haven’t seen much of this year: a reprieve.

Despite a hairy eighth inning, the Mets managed to hold on in a 7-5 come-from-behind win over the A’s last night. Michael Conforto hit two homers, Jerry Blevins’ five-out save kept the Mets from the brink of oblivion, and for once, bad stuff happened to the other guys.

But first, Cespedes. It was about three hours before the game when the star leftfielder — whose blue hair, fittingly, has oxidized to A’s green — told the San Francisco Chronicle that he hoped to end his career with the team he started it with. “That’s my goal,” he said, heaping on admiration for Melvin. “I tell my guys here all the time that he’s the best manager for me so far . . . I don’t think there’s a better manager than Melvin.”

After, he clarified his comments, which were given in English, and not through an interpreter, like he generally uses. Did he really want to end his career in Oakland? Well, yes.

advertisement | advertise on newsday

“With respect to the comments I made about their manager, he’s a great manager,” he said, this time with a translator. “That does not mean that I do not have a good relationship with Terry [Collins], that we don’t get along well, that I don’t respect him . . . This is my home, this is my team . . . Nothing has changed that.”

It was perhaps too bad for the Mets that they couldn’t even fully enjoy a heartening win — one where Blevins, coming in to bail out a struggling Addison Reed.

The Mets had a four-run lead in the eighth when Erik Goeddel and Reed gave up two runs, forcing Collins to trot out Blevins with the bases loaded. But Blevins, the former Oakland pitcher, got Yonder Alonso to pop out in foul territory and struck out Khris Davis swinging on a high fastball.

“[Travis d’Arnaud] and I, especially when Davis came out, we had a two-pitch sequence and we executed both,” Blevins said. “He didn’t swing at the curveball in the dirt and we wanted to shoot a fastball up and he swung underneath it. It was a good job by Travis and we had a game plan.”

That was the exciting part. The bizarre part was earlier.

Mets videos

The A’s actually had a one-run lead going into the sixth, when a series of misadventures proved that the Mets don’t actually have a monopoly on bad breaks.

Down by one with runners on first and second with one out, Lucas Duda hit a chopper toward first that took a high, hard hop and smacked Ryon Healy in the face. Healy, who stayed down some time and had to leave the game, couldn’t make the play, loading the bases for T.J. Rivera. Then things got really weird.

Rivera hit a single up the middle that squeaked into centerfield. The runners on second and third, Cespedes and Asdrubal Cabrera, scored to give the Mets the lead. But with no play at the plate, the throw came into Matt Chapman at third to get Duda. But with Rivera going, Chapman tagged Duda and rushed the throw to second, throwing the ball away and allowing Rivera to score for a 5-3 lead.

Conforto’s two homers — giving him 18 for the season — were both two-run shots, tying a career high with four RBIs. His second blast, in the seventh, made it 7-3. His 459-foot bomb in the third, toward Shea Bridge, briefly put the Mets up 2-1. Matz, not sharp for the third straight start, gave up three runs on nine hits over five innings.