All day, Braves left-hander Alex Wood had quieted Pirates fans and relegated pitching coach Roger McDowell to the dugout to watch him work.

But now the Pirates had an opening in the bottom of the seventh inning. Back-to-back singles by Andrew McCutchen and Starling Marte followed by a sacrifice by Francisco Cervelli had PNC Park buzzing about erasing a two-run deficit. McDowell trotted out to the mound for a chat.

It turned out to be a mere minor setback on a dominant day for Wood. He quickly reestablished the status quo by striking out Jordy Mercer and getting Sean Rodriguez to pop out to second baseman Jace Peterson to cork the rally.

The lead was preserved and the Braves made it hold up for a 2-1 victory Sunday. The Braves (36-40) ended their season-long losing streak at five games and avoided a second consecutive sweep.

The Pirates (42-33) had just five hits against Wood — only one for extra bases — and struck out eight times over 7 1/3 innings. Wood (5-5) mixed in sharp curveballs and effective changeups with a fastball that consistently hit the corner of the plate.

“When you have a day like today when you’ve got all three going, they usually turn into fun days,” Wood said. “We needed a win today and everybody came to play. It definitely feels good to get out of Pittsburgh with a ‘W.’”

The Braves had to survive some tense moments late to pull it off. The Pirates threatened again in the eighth inning when pinch hitter Neil Walker knocked a one-out double to chase Wood, who gave way to Jim Johnson.

Johnson struck out Josh Harrison and pinch hitter Pedro Alvarez flied out to end the inning. Closer Jason Grilli recorded two outs in the ninth before walking Cervelli. The victory appeared secure when center fielder Cameron Maybin made a long run and gathered under Jordy Mercer’s drive at the warning track.

But left fielder Eury Perez failed to give way to Maybin and the two collided at the wall as the ball popped out of Maybin’s glove. The double scored Cervelli and Grilli had to face pinch hitter Gregory Polanco with the potential tying run at second base. Perez had to leave the game after the collision but was not seriously injured.

Grilli had Polanco down 0-2 in the count before Polanco worked it back to full. He struck out on a check swing to end the game.

The Braves lost the series opener on Friday when Grilli , a former All-Star for the Pirates, gave up a walk-off double.

“Woody pitched phenomenal. J.J. came in to get those big outs and then to put the finishing touches on it, it’s always big,” Grilli said. “Obviously for me personally, it’s good to walk away and come back from the other night’s performance.”

Wood had his first scoreless outing since limiting the Phillies to five hits over 5 2/3 innings on April 24. He matched the eight strikeouts he had against the Nationals on April 29 and won for the first time in his past four decisions.

“He had all three of his pitches working, moving his fastball around, getting ahead in the count,” Braves catcher A.J. Pierzynski said. “That’s what he can do. When he’s right, he can dominate lineups and today you saw a glimpse of what he’s capable of.”

The Braves scraped up just enough offense to back up Wood. They scored a combined 10 runs in the two series against the Nationals and Pirates.

Pirates left-hander Jeff Locke (4-4) recorded his first 13 outs by way of strikeout or ground balls. The Braves finally broke through in the fifth inning when Maybin hit a one-out single, advanced to second on a passed ball by Cervelli and scored on Nick Markakis’ single.

The Braved made Locke throw 94 pitches to get through five innings before he gave way to the bullpen. The Braves added Peterson’s lead-off homer in the seventh inning to provide some cushion.

“It’s never easy to win a big-league ballgame even though you have a two-run lead and we did it,” Braves manager Fredi Gonzalez said. “A happy plane going back to an off day is always good.”