MILWAUKEE (AP) -- Yovani Gallardo gave up too many hits. And even when the Milwaukee fielders got the ball, they didn't help.
Gallardo was knocked around for six runs and the NL Central-leading Brewers committed three errors Friday night in an 8-3 loss to the Pittsburgh Pirates.
"We played poor on defense and didn't pitch well," manager Ron Roenicke said. "We didn't get a lot of hits off (Jeff) Locke, but we had a lot of baserunners out there. We just didn't get the big hit when we needed it."
Gallardo (8-7) lasted just five innings, allowing eight hits and three walks.
"I was not throwing balls where I wanted to, and obviously they were up in the zone," he said. "Those kind of things can't happen."
Said Roenicke: "Yovani didn't throw the ball well, but we never really gave him a chance to get into a rhythm."
"The first five runs they scored, we gave to them. You can't do that," he said,
Josh Harrison homered, doubled, single and drove in a career-high five runs for Pittsburgh, which had lost nine of 12 going into this series.
With this win, Pittsburgh now trails Milwaukee by five games.
Locke (5-3) pitched six innings, giving up two runs and two hits. He walked six, but was able to strand five runners.
Ryan Braun's two-run homer in the first inning gave Milwaukee a 2-0 lead. It was his 16th home run of the season, but just his second since July 22 as he's been slowed by a sore thumb.
Pittsburgh came right back in the second for 3-2 lead, taking advantage of Gallardo's wildness as he issued two straight walk after an error by third baseman Aramis Ramirez. Jody Mercer hit a sacrifice fly and Harrison lined a two-run double.
The Pirates made it 4-2 on Neil Walker's RBI triple in the third and Harrison singled home a run in the fourth.
Andrew McCutchen hit his 18th home run of the season leading off the fifth. It was his third game since coming off the disabled list because of a rib fracture and it was his first home run since he hit two against Cincinnati on July 12.
Harrison hit a two-run homer in the eighth.
As Milwaukee tried to mount a comeback, a key play involving Harrison in the sixth inning went against the Brewers not once, but twice. With two runners on and two out, Rickie Weeks grounded to SS Mercer, who threw to Harrison at third base. But Harrison was off the bag and stepped on it just as Ramirez slid in. The Brewers challenged the call as it appeared Ramirez beat the tag. But the call was upheld and the inning was over.
Roenicke said Ramirez was safe.
"That's what bothers me about replay," he said. "If we're going to do replay, slow it down and get all these angles, then get the play right. It would have given us bases loaded with (Mark) Reynolds coming up. If you piece together two different angles, he's safe and it's easy to see."
Pirates: Hurdle expressed cautious optimism that INF Clint Barmes would be able to rejoin the team during a three-game series with St. Louis that starts Monday. Barmes has been out since early July with a left groin strain and is currently on a rehab assignment with Triple-A Indianapolis.
Brewers: RHP Kyle Lohse, who missed his last start due to a sore right ankle, is set to start Monday against the San Diego Padres. Lohse threw a bullpen session Friday and said afterward he felt good. ... RHP Matt Garza (left oblique strain) will throw a bullpen session Sunday. Roenicke said he hopes Garza would return to the starting rotation in early September.
Pirates: RHP Edinson Volquez (10-7) starts Saturday at Miller Park. He has won six of this last seven decisions.
Brewers: RHP Wily Peralta (15-7), tied for the major league lead in wins, faces the Pirates.