PITTSBURGH (AP) -- Lorenzo Cain delivered a go-ahead RBI single off Pittsburgh closer Felipe Vazquez in the top of the 10th inning and the Milwaukee Brewers recovered after blowing a five-run lead in the ninth to edge the Pittsburgh Pirates 7-6 on Friday night and snap a three-game losing streak.
Pittsburgh trailed 6-1 going into the ninth, but rallied to tie it. Adam Frazier's RBI single got Pittsburgh 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.
The Brewers, however, bounced back against Vazquez (2-1).
Orlando Arcia singled with one out, moved to third on Manny Pina's single and scored when Cain's sharp grounder got through the hole between first and second base.
Arcia finished 2 for 4, including his 12th home run of the season. Pina 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 as Milwaukee moved a half-game in front of the idle Chicago Cubs for first in the NL Central.
Aguilar took advantage of just his second start since mid-June to hit his sixth homer of the season and drive in three runs. Milwaukee manager Craig Counsell re-inserted Aguilar into the starting lineup in hopes of giving the offense a jolt after the Brewers were shutout 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.
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. Frazier finished with three hits and is batting .619 (13 of 21) over his last five games.
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.
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.