PITTSBURGH – Alex Wood didn't need much run support Wednesday, but the Braves didn't provide enough to get the left-hander or themselves a win on a night when he pitched a gem and they made costly mistakes late.

This one stung, folks.

The Pirates scored two runs in the eighth and took advantage of a Justin Upton error in the ninth to pull out a 3-2 win on Gaby Sanchez’s one-out sacrifice fly. The Braves had their five-game winnig streak snapped, while the Pirates averted a sweep and ended a season-high seven-game skid.

“You hate to lose a game like this, because we had a lot of positive stuff,” said manager Fredi Gonzalez, whose Braves slipped to seven games behind National League East leader Washington with 35 games remaining, and to 1 1/2 games behind San Francisco for the second NL wild-card spot.

The positives were overshadowed by the blown lead, the wild pitch, the ninth-inning error….

“It’s tough,” said reliever Jordan Walden, whose wild pitch let in the tying run in the eighth inning. “I feel bad because Woody pitched his butt off. It sucks to see the outcome of that.”

Reliever David Carpenter gave up a Jody Mercer single to start the ninth. One out later, Starling Marte hit a fly ball to the left-center gap that the Upton brothers, Justin and B.J., both pursued. Left fielder Justin, who insisted he wasn’t distracted by his brother nearby, had the ball bounce off his glove, allowing Marte to advance to second and Mercer to third.

With two in scoring position, Sanchez lifted a fly to deep center for the walk-off win.

“B.J.’s playing the gap, I’m playing straight up — that was a huge gap there,” Upton said. “We covered some ground and just couldn’t get there.”

The problem with that explanation was that everyone could see the ball bounce off his glove after he did get to it. It appeared Justin Upton altered his path slightly at the last moment to make sure there was no collision, but he said that wasn’t the case.

“Yeah, I saw him,” Justin Upton said. “There was nothing you could do. That ball was literally right between, both of us couldn’t get to it. It was just perfect placement…. We both got there at the same time. I took the lead and tried to go get it, and it just tipped off the end of my glove.”

Gonzalez said, “We make that play 99 out of 100 times – 99 ½. We didn’t make it. But like I said earlier, you hate to end a game like this because there was a lot of good stuff.”

Wood faced one over the minimum number of hitters through seven innings and had recorded 17 outs in a span of 17 batters before giving up a walk and a Travis Snider double on an 0-2 breaking ball to start the eighth. He was replaced by Walden with two in scoring position and a 2-0 lead, and both runners scored on a groundout and a Walden wild pitch.

“You can’t put your setup guy in that position,” said Wood, who was typically hard on himself. “You’re in a 2-nothing game, you can’t walk the leadoff guy and then go 0-2 to the only left-hander in the lineup and hang a breaking ball. (The pitch) has to be buried. If you want to go deep in games and be the best in the league, that can’t happen in the eighth inning. It’s really inexcusable. It stinks.”

The first batter Walden faced, Chris Stewart, hit a grounder to first base to cut the lead to 2-1. And Walden threw a wild pitch on ball 4 to the next batter, switch-hitting pinch-hitter Neil Walker, that allowed Snider to score the tying run.

Walden said he wouldn’t have changed his pitch selection — Gonzalez said the breaking ball is what makes Walden so effective against left-handers — but that he simply didn’t execute the pitch properly.

“I’ve got to finish the job,” Walden said. “I made a bad pitch to Walker, that’s it.”

Gonzalez said he didn’t think catcher Evan Gattis could’ve been expected to block the bounced pitch, and commended for blocking the previous one.

With both runs charged to Wood, the lefty ended up with a line that read seven-plus innings, four hits, two runs and one walk with four strikeouts. He threw 64 strikes in 98 pitches.

Wood’s pitching line was good, but perhaps still not indicative of how well the second-year pitcher performed in allowing two or fewer earned runs in six or more innings for the fifth consecutive start.

Asked if Wood deserved a better fate, Gonzalez said, “Well, you know what. Yeah, obviously. But we start the eighth inning there with a walk and an 0-2 double that put (us) behind the 8-ball there. But he pitched good…. Woody pitched seven (innings) in about (as good) a command of a game as you’ve seen him pitch in a while.”

After giving up a Josh Harrison double to start the first inning, Wood picked him off at second – he and shortstop Andrelton Simmons have perfected that sneaky play – and set the tone for a mostly frustrating night for Pittsburgh hitters.

The Pirates got a one-out single in the second inning and didn’t have another base runner until a one-out single by Snider in the fifth, when Wood induced a double-play grounder by the next batter, Chris Stewart.

Wood had retired seven in a row before walking Sanchez to start the eighth.

The trio that led the Braves’ recent offensive turnaround – Jason Heyward, Freddie Freeman, Justin Upton — came through again Wednesday, though not in anything approaching the resounding manner of the first two games in the series, when the Braves totaled 29 hits and outscored the Pirates 18-6.

The Braves got five hits Wednesday in seven innings against Gerrit Cole, who had spent the past six weeks on the disabled list for a back strain. Heyward doubled and scored two runs, and Freeman and Upton each had a key hit and walk.

Cole walked Heyward to start the game. Freeman and Upton hit consecutive one-out singles, with the latter scoring Heyward for a 1-0 lead and extending Upton’s hitting streak to 11 games.

The Braves had a chance to do more damage against Cole in the first inning, but Chris Johnson grounded into a double play for the 18th time, tied with Simmons for third-most in the National League.

When Johnson got a second chance to hit with runners in scoring position and one out in the sixth, he came through with a single to right field.

Heyward, who had doubled to start the inning, scored on Johnson’s opposite-field hit, but Freeman was thrown out trying to score a second run on the play. Freeman had been walked intentionally with one out and Heyward at third after a Simmons sacrifice bunt, and Upton had worked a full count before walking to load the bases for Johnson.

Evan Gattis struck out to end the inning, so the Braves had to settle for one run after loading the bases with one out. But the way Wood and the bullpen have pitched lately, there was a good chance a 2-0 lead would be enough. But it didn’t.