PITTSBURGH -- A seemingly safe five-run ninth-inning lead gone in a flash, the Milwaukee Brewers were badly in need of a pickup.
Facing one of the best closers in the majors, Orlando Arcia provided one.
The shortstop's sharp single off Pittsburgh's Felipe Vázquez in the top of the 10th inning started a rally that ended with Lorenzo Cain's go-ahead RBI single to put the Brewers ahead for good as Milwaukee ended a three-game losing streak to move in front of idle Chicago for first-place in the airtight NL Central.
"I think it's one of those things where you have to do something good to change around the feeling," Brewers manager Craig Counsell said.
Good feelings were in short supply in the Milwaukee dugout after the Pirates erased a five-run deficit in the ninth.
Starling Marte's sacrifice fly scored Melky Cabrera and got the Pirates going. All-Star first baseman Josh Bell followed two batters later with a three-run shot to the right-field seats off Delios Guerra to get Pittsburgh within one. Milwaukee reliever Junior Guerra came on in an attempt to get the final out. His first pitch to Jung Ho Kang ended up in the left-field bleachers to tie the game.
"That pitch to Kang was kind of in the middle," Junior Guerra said. "I expect that he's not going to swing on the first pitch. That's why I don't throw fastball."
The Brewers, however, bounced back against Vázquez (2-1). Arcia singled with one out, moved to third on Manny Piña's single and scored when Cain's sharp grounder got through the hole between first and second base.
"A lot of things happened," Cain said. "We had the lead there in the end. They ended up coming back. At the end of the day, we find a way to come back and win. We definitely needed that. It was a big boost for the boys."
Arcia finished 2 for 4, including his 12th home run of the season. Piña and Jesus Aguilar both hit two-run shots during Milwaukee's four-run eighth that gave the Brewers a five-run lead the bullpen squandered.
Junior Guerra (3-1) picked up the win after blowing the save when he struck out pinch-hitter Joe Musgrove — a starting pitcher by trade — with two on in the bottom of the 10th.
"It felt like the Twilight Zone in a lot of ways," Counsell said.
Aguilar took advantage of just his second start since mid-June to hit his sixth homer of the season and drive in three runs. Counsell re-inserted Aguilar into the starting lineup in hopes of giving the offense a jolt after the Brewers were shut out on consecutive days by Cincinnati.
The first baseman responded by ending Milwaukee's 26-inning scoreless drought with an RBI single in the fourth off Pirates starter Steven Brault then provided some insurance with a two-run shot to the bleachers in left field in the eighth.
The Brewers arrived in Pittsburgh coming off a listless series in Cincinnati in which they dropped three of four as the gap between first and fifth in the tight Central shrank to 3 1/2 games. Counsell took Yasmani Grandal out of the leadoff spot, dropped Mike Moustakas from third to cleanup and gave Aguilar — an All-Star in 2018 — a start in place of Eric Thames.
Aguilar came in hitting .203 on the season, but collected just his second multiple-hit game since May 12. He ripped a single to right field with two outs in the fourth to give the Brewers their first run since the sixth inning of an 11-inning loss to Cincinnati on Tuesday.
The Brewers appeared to be in good shape after Josh Hader wiggled out of a bases-loaded jam in the seventh and a four-run eighth pushed Milwaukee's lead to five.
Bell, who will compete in the Home Run Derby on Monday night in Cleveland, now has 27 home runs on the season and five in his last five games. Adam Frazier finished with three hits and is batting .619 (13 of 21) in July. Pittsburgh has dropped two straight following a stretch in which it went 12-5 to get back into the NL Central race. Despite the loss, Bell believes Pittsburgh's comeback will pay off going forward.
"I think it sends a message to them it doesn't matter what the score is," Bell said. "We're right there knocking on the door."
Brault exited after walking Arcia leading off the fifth with discomfort in his left (throwing) shoulder. Brault, coming off a June in which he posted a 2.52 ERA after injuries forced him to join Pittsburgh's starting rotation full-time, allowed one run on two hits with two walks and four strikeouts.
"It was just tight after every inning," Brault said. "And in that fifth inning I wasn't able to get to the point where I needed to be. It was obvious seeing my velocity drop."
Brewers: LF Ryan Braun's sore right knee is catching up with him. The 35-year-old said he initially hurt the knee during the 2018 playoffs and irritated the injury while making a sliding catch in Cincinnati on Tuesday. The 2011 National League MVP didn't start on Friday but did leg out a double to center as a pinch hitter in the seventh.
Pirates: C Francisco Cervelli (concussion) is open to switching positions in an effort to help the team. Cervelli hasn't played since taking a broken bat to the chin against the Los Angeles Dodgers on May 25.
Brewers: Adrian Houser (2-2, 3.26 ERA) is 0-2 with a 7.62 ERA while working as an "opener" this season. Houser pitches a season-high five innings against Cincinnati on Monday.
Pirates: Dario Agrazal (1-0, 2.70) will make his third major-league start on Saturday in place of Trevor Williams, who was placed on the paternity list Friday evening.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP—Sports