One of the longest series in recent memory ended with a thud Thursday night for the Braves, as David Wright hit two homers and led the Mets to a 4-3 win in the finale of a five-game set that didn’t go well for the team that had the best home record in baseball.

Mike Minor gave up three homers and lost for the first time in 10 starts, and the Mets won the series, 3-2.

“We had 13 hits and only three runs, that’s about it,” said manager Fredi Gonzalez, whose Braves had won 16 of 20 home games before losing three of the last four in the series. “We had some people on base, and we just couldn’t get the knock when we needed to.”

The Braves went 3-for-13 with runners in scoring position and left 11 on base, including seven in the first four innings.

“It’s tough, we lose a couple of one-run ballgames that definitely could have gone either way,” said Braves center fielder B.J. Upton, who on his bobblehead night went 0-for-5 with two strikeouts and grounded into a double play. “We felt like we should have won them, but we didn’t. We’re not going to hang our heads. We obviously still have the division lead, and we’re still playing good baseball. And we’ll get ready to play tomorrow.”

Atlanta lost a game in the National League East standings, but still has a six-game lead over second-place Washington. The Braves left town afteward for a five-game trip to Milwaukee and Kansas City, beginning with a weekend series against the Brewers that starts Friday.

Tyler Pastornicky, just up from Triple-A, had three hits for the Braves, but they wasted too many scoring opportunities, a trend that continued throughout the series. Third baseman Chris Johnson made three errors, the first Brave to do that since Juan Francisco made three at Houston on April 9, 2012, but they didn’t cost any runs.

The Braves trailed 4-3 in the eighth when Andrelton Simmons reached on a one-out error by Wright. Pastornicky’s two-out single put runners on the corners for Jason Heyward, and the Mets brought in left-hander Josh Edgin. Heyward grounded out to end the inning.

“We just didn’t get that extra run,” Gonzalez said.

Minor (8-3) was charged with nine hits and four runs in six innings, including three solo homers. He left after giving up the go-ahead run on consecutive doubles to start the seventh.

“On the two doubles, I felt like I made pretty good pitches,” he said. “But the home runs were just bad pitches. Hanging curveball, fastball over the middle of the plate, and then a first-pitch hanging slider. Give the credit to those guys – they were bad pitches, they took them out of the yard.”

Minor gave up more homers in the first five innings than he had allowed in his past six starts (two). He allowed more than two homers for the first time in nearly a year, since giving up three at Boston on June 24, 2012.

He was taken deep twice by Wright, who has a career-high 32 homers in 156 games against the Braves, including four in 10 games this season. The third baseman’s 18 homers in 81 games at Turner Field are the most he’s hit anywhere outside New York, and equal to half of his homer total in 316 games at Citi Field.

“To David Wright, who’s a really good hitter, I threw a fastball over the middle of the plate,” Minor said, describing the damage in a matter-of-fact monotone. “It was up, in the middle. And then a hanging curveball, which was over the middle. So, that’s what that guy does.”

Minor had been 15-6 with a 2.44 ERA in 29 starts since the beginning of July, and 5-0 with a 2.44 ERA in his past nine starts before Thursday. But after giving up two earned runs or fewer in eight consecutive outing, he’s allowed four in each of his past two, surrendering 16 hits and nine runs (eight earned) in 12 innings of those games.

“I just feel like in certain situations I make bad pitches,” he said of his recent starts. “I make stupid decisions, and I really don’t throw the ball down in the zone when I need to. I guess the last half of the year and this first half, I feel like I made a lot better pitches. But the last couple, all the way back to the Pirates (on June 4), pitch selection and where I threw it were just not (what) I want.”

Wright staked starter Jonathon Niese to a 1-0 lead in the first with his two-out solo homer on a second-pitch fastball. He homered again leading off the fourth on an 0-1 curveball, his 20th multihomer game and second this season.

Niese lasted 3 1/3 innings and gave up eight hits and three runs before leaving with discomfort in his left (pitching) shoulder. The Braves didn’t score a run the rest of the way against five Mets relievers.

Wright was 2-for-17 with seven strikeouts and no homers against Minor before Thursday, when he went 3-for-3 against the lefty. Wright didn’t make an out until striking out in the seventh against Jordan Walden, who pitched two perfect innings with three strikeouts in his longest outing this season.

The Mets took a 4-3 lead in the seventh when Minor gave up consecutive doubles to No. 8 hitter Omar Quintanilla and pinch-hitter Josh Satin. Walden replaced him and retired the next three batters.

In between Wright’s home runs the Braves built a 3-1 lead, but also stranded a lot of runners.

The Braves got consecutive singles from Pastornicky and Heyward to start the first inning, and Justin Upton drove in a run with a good piece of hitting on an inside-out swing for a broken-bat single to right field.

That scored Pastornicky, who had ventured far off second on Freddie Freeman’s fly out to deep center, but hustled back to tag up and beat the throw to third. The Braves still had runners on the corners and only one out after Upton’s single, but B.J. Upton and Johnson both struck out to end the inning.

“That first at-bat, I’ve got to make something happen,” B.J. Upton said. “At least put the ball in play (with runners at) first and third, give ourselves a chance to score a run.”

Gonzalez said: “That’s big. You get first and third there and that’s all we got, the single by Justin. You get those opportunities, you’ve got to still keep trying to add on, and we didn’t do that today.”

Four singles yielded two runs in the Braves’ third inning, with consecutive two-out hits by Johnson and Gerald Laird driving in the runs for a 3-1 lead.

Minor has been the Braves’ best and most consistent starter and the one they would most want on the mound pitching with a lead. But he couldn’t protect one against the Mets, giving up leadoff homers to Wright in the fourth and pinch-hitter Andrew Brown on a first-pitch slider in the fifth for a 3-3 tie.

Minor got a no-decision in that start against San Francisco, when the Braves scored two runs in the seventh and two in the ninth to pull out a 6-5 win. They scored four or more runs while Minor was in the game in eight of his past nine starts before Thursday, including seven or more runs in four starts.