PITTSBURGH - Aramis Ramirez went 4-for-5 with a homer and four RBIs and Caleb Gindl drove in the tiebreaking run with a sacrifice fly as visiting Milwaukee outlasted Pittsburgh.
Yuniesky Betancourt doubled off Bryan Morris (5-7) with one out in the eighth, moved to third on Scooter Gennett's bunt single and scored on Gindl's fly to right as the Brewers won the opener of the three-game set.
The Pirates fell one game behind first-place St. Louis in the National League Central.
Rob Wooten (3-0) gave up one run in 1 2/3 innings, Brandon Kintzler worked a perfect eighth and Jim Henderson retired Gaby Sanchez with two runners on in the ninth to record his 22nd save in 25 opportunities.
Ramirez hit a solo homer in the second – the 350th of his career – and blasted a two-run double during a three-run fifth as Milwaukee took a 5-0 lead.
Pittsburgh tallied four times in the bottom of the fifth when Norichika Aoki was unable to catch Felix Pie's two-out double and Neil Walker followed with a three-run blast to right.
The Pirates tied the score on Pie's single to right in the sixth and Ramirez put the Brewers back ahead with a run-scoring single in the seventh before Pedro Alvarez hammered a tying homer off the right-field foul pole in the bottom of the frame for one of his four hits.
GAME NOTEBOOK: The Pirates acquired OF Marlon Byrd and C John Buck from the New York Mets for minor-league INF Dilson Herrera and a player to be named. … Brewers starter Kyle Lohse gave up five runs and a season-high 13 hits in 5 1/3 innings, while Pittsburgh's Jeff Locke gave up five runs and eight hits in 4 2/3 innings in his seventh straight winless outing. … Injured Pittsburgh OF Starling Marte (right hand) saw a hand specialist on Tuesday. It was determined he doesn't need surgery but that it would be at least two more weeks before he can swing a bat.