A long road trip, a long series and a long afternoon ended with a pitcher on the mound who was told he had the day off. Entering Thursday, no reliever in baseball had appeared in more games than Diamondbacks right-hander Brad Ziegler, and yet there he was again on Thursday afternoon — or was it evening? — the ball in his hand, the game on the line.

“It’s almost borderline comical,” fellow reliever J.J. Putz said. “They tell you, ‘We’re going to try to stay away from you. But maybe in the 15th inning or something…’ And then the 15th inning rolls around.”

Ziegler managed to accomplish what two teammates before him had failed to do: He closed out a win in a wild, back-and-forth affair against the New York Mets, a game the Diamondbacks won 5-4 in 15 innings at Citi Field, ending a 10-game road trip in upbeat fashion.

There’s no sugarcoating it: The trip through Washington, Atlanta and here was still a disaster at 3-7. But imagine how it would have felt if they’d lost Thursday — or Wednesday when they managed to beat Mets ace Matt Harvey.

“If you’re going to lose that many games and only win three,” shortstop Cliff Pennington said, “I guess winning the last two is the best way to do it.”

They almost didn’t.

If save percentages were like batting averages, then the bullpen had a nice day. Unfortunately, they aren’t, but despite two blown saves the Diamondbacks still found a way to win yet another marathon, moving to 3-0 this season in games that have lasted at least 14 innings.

They have, among many others, Pennington to thank for his go-ahead single in the top of the 15th. They have Ziegler, who pitched for the third time in four games in this series and worked a scoreless, albeit tense, bottom of the 15th. They have catcher Wil Nieves, who caught every inning and contributed four hits.

“You’ve just got to tell yourself you can take it,” manager Kirk Gibson said. “You learn a lot about yourself in series like this and days like this. (We learned) that we’re not going to give in.”

It was 2-2 after five innings, and it stayed that way until the top of the 13th, when Cody Ross drew a bases-loaded walk to force home the go-ahead run. But with two outs in the 13th, the Mets’ Anthony Recker — who at the moment was hitting .167 — drilled a solo home run off closer Heath Bell to tie it back up.

The Diamondbacks struck again the next half inning, Martin Prado’s RBI single giving them another one-run lead. But, again, the Mets answered. This time, it was Kirk Nieuwenhuis — who, believe it or not, was also hitting .167 when he came to the plate — who deposited a homer to left-center field off reliever Chaz Roe.

“I don’t think I’ve ever seen anything like that,” Nieves said. “We scored and then the guy who hits the homer is hitting .160. And then we score (again) and the next guy hits another homer and he’s hitting .170.”

But the Diamondbacks, who made grit their buzzword in the off-season, showed some. With two out in the 15th, Gerardo Parra and Nieves hit consecutive singles, setting the stage for Pennington, who drove in Parra with a hit to left. The hit made Pennington 8 for 11 (.727) this season in extra innings.