Ryan Doumit homered and drove in two runs as the Pirates ended more than a year of futility against the NL Central leaders with a 9-2 win in the second game of a doubleheader on Monday night.
The Brewers took the opener 8-1 for their 13th straight victory over Pittsburgh, but the Pirates pounded Milwaukee ace Zack Greinke in the second game.
"We were able to do some things we haven't been able to do against them, getting some timely hits, getting some hits with runners in scoring position, running the bases aggressively," Pirates manager Clint Hurdle said.
Greinke (12-5) gave up seven runs and seven hits in 6 1/3 innings in losing for the first time in a month. The defeat was just the fourth in the last 23 games for the NL Central-leading Brewers.
Daniel McCutchen (4-3) earned the victory in relief of spot starter Brad Lincoln, who held the surging Brewers to two runs over six innings. Pittsburgh beat the Brewers for the first time since July 21, 2010.
The Brewers have been baseball's best team over the last month, thanks in part to Greinke. The right-hander came in 5-0 in his last five starts with a 1.58 ERA and was a perfect 3-0 in his career against the Pirates.
Greinke ran into trouble in the seventh as the Pirates let out a year of frustration, scoring a season-high seven runs in the inning. There wasn't one big hit, but a series of little ones.
A bout of unexpected wildness from Greinke helped Pittsburgh. The former Cy Young winner hit Matt Diaz with a pitch, and he later came around to score on a wild pitch.
"Things just fell apart that inning," Milwaukee manager Ron Roenicke said. "I think when he hit Diaz, that started it, but after that, we just fell apart."
Jose Tabata added two hits for the Pirates to finish with five in the doubleheader. The 23-year-old outfielder is 7 for 13 since signing a six-year contract extension on Sunday.
"He hasn't missed a click," Hurdle said.
Pittsburgh's outburst seemed unlikely after the Brewers romped to victory in the opener and quickly jumped on Lincoln in the nightcap. Corey Hart led off the game with his 19th homer of the season and the Brewers added a second run on an RBI groundout by Prince Fielder.
Yet Lincoln settled down after that, allowing just one hit over his final five innings.
"I just wanted to give my team a chance to win and get deep into the game," Lincoln said.
He did more than enough to impress Hurdle, who said Lincoln will join the rotation temporarily after starter Kevin Correia was placed on the 15-day DL with a strained oblique.
Even with the loss the Brewers saw their lead over second-place St. Louis rise to nine games, the club's largest-ever lead in the standings.
"When you're on the road, you're playing a doubleheader, you're fine with a split," Roenicke said. "I mean, hey, you would have liked to have won two games and played a solid game all the way through, but some things happened."
In the opener, left-hander Chris Narveson came off the disabled list and pitched shutout ball into the sixth inning. He also knocked in two runs.
Narveson gave up five hits, walked one and struck out three before being forced to leave with one out in the sixth after the nail on his left middle finger started to tear.
It's the second finger-related injury Narveson (9-6) has sustained this month. He lacerated his left thumb while repairing his glove two weeks ago, sending him to the 15-day DL.
The nail shouldn't be as troublesome, though he took a good ribbing from his teammates.
"(Randy Wolf) said he was going to send me to a manicurist," Narveson said.
Narveson made a contribution with his bat, giving Milwaukee the lead in the fourth.
Karstens intentionally walked Craig Counsell to load the bases with two outs. Narveson fell behind 1-2 before hitting a curveball to right for a two-run single.
"It was probably too good a pitch for him to take," Karstens said. "I've got to make better pitches than that in that situation."
Narveson cruised into the sixth before grimacing after his nail bent awkwardly while he was pitching to Steve Pearce. Though he wanted to stay in after throwing just 85 pitches, Narveson didn't think it was worth the risk.
"I knew if I threw one pitch and it ended it up catching it good and pulling it back or pulling it off, I knew I'd be in big trouble," he said. "I figured, I think we caught it and it should be good."
Narveson gave way to Kameron Loe, and Milwaukee's bullpen limited the Pirates to one run over the final 3 2/3 innings.
Ryan Ludwick hit his 12th homer of the season, and first since being acquired by the Pirates just before the trade deadline.
The series continues on Tuesday. Marco Estrada (3-8, 4.28 ERA) will start for the Brewers while Ross Ohlendorf (0-0, 7.27 ERA) gets the nod for the Pirates. ... Estrada, a part-time reliever, is 2-2 with a 3.93 ERA in his six starts this year. ... Ohlendorf will be making his first start since April 8, when he left the game with discomfort in his left shoulder and was placed on the disabled list. ... Milwaukee OF Carlos Gomez will take batting practice Tuesday for the first time since fracturing his left clavicle while making a diving catch in Arizona on July 20. ... Milwaukee 2B Rickie Weeks ran on a treadmill as he continues to recover from a severely sprained ankle.