Gaby Sanchez singled to start the 14th and stole second. Jordy Mercer walked, and pinch-hitter Russell Martin, the last player on Pittsburgh's bench, singled up the middle to give the Bucs their ninth straight win.
The Pirates bullpen allowed just two hits and no runs over 12 innings. Outside of Martin Maldonado's 3-for-5 afternoon, the Brewers went 1-for-41.
"It feels like they all throw 110 [mph]," Brewers outfielder Logan Schafer said. "They've all got good stuff. They know what they're doing. They locate for the most part. And in a game like this, it's essential to get strikes early. They're pretty effective at getting ahead in counts, and that's big on their end."
Francisco Rodriguez loaded the bases in the 13th, but he got Pedro Alvarez, who went 0-for-6, to ground into a 3-6-3 double play with one out.
The Pirates enter July with 51 wins, the most in baseball and a record for a franchise that goes back 127 years. The Brewers, meanwhile, fell a season-worst 16 games under .500 and are 32-48 entering Monday's series opener in Washington, D.C., at the mathematical midpoint of their season. They've dropped five in a row.
"That's baseball. Your winning streaks and your losing streaks are never really one for one," Schafer said. "As far as the breaks go, it's been tough, but at some point we'll get them back. But there's nothing we can do about some of the breaks. We just continue to play the game hard, and hopefully things start falling our way."
Brandon Kintzler pitched perfect 10th, 11th and 12th innings for Milwaukee in relief, striking out three. Pirates lefty Tony Watson tossed scoreless 12th-14th innings and fanned four.
"Look at that team, the way they played after losing the first two," Pirates manager Clint Hurdle said. "The way they pitched. There was a lot going on out there."
The Brewers took a 1-0 lead in the top of the second inning on Schafer's safety-squeeze bunt, but the weather denied starter Kyle Lohse a bid for his 10th career victory over the Pirates when a nasty storm blanketed Pittsburgh in the bottom of the second inning. The long delay prompted the Brewers to turn to 24-year-old top prospect Tyler Thornburg and the Pirates to right-hander Vin Mazzaro in place of starter Charlie Morton.
Both were effective. Thornburg recorded nine outs before allowing the first Pirates hit, a Clint Barmes double down the left-field line with two outs in the fifth, one of two hits off Thornburg in five scoreless innings. He received a huge assist from left fielder Schafer, whose leaping catch in the seventh inning robbed Sanchez of a solo home run that would have tied the game at 1.
Thornburg was 0-9 with a 5.79 ERA with Triple-A Nashville, but he has now pitched nine scoreless innings in three appearances for the Brewers.
"Honestly, I was blessed to get this opportunity and fortunate to be throwing well," Thornburg said. "Luck may have a lot to do with it, and what's going on in Triple-A, I really can't say. But I'm throwing the ball well up here so far."
But Mazzaro was even better, retiring all 15 Brewers batters he faced. The Brewers' 1-0 lead lasted into the bottom of the eighth inning, when Jean Segura couldn't come up with a hard Starling Marte grounder hit right at the young shortstop. It was ruled a hit.
"Today, I thought [Segura] was OK," said Brewers manager Ron Roenicke, who has praised his shortstop for his defense recently. "He had one bullet hit at him that he tried to get in front of. But yesterday was the bad one. He hasn't had bad games like that."
Marte advanced on a groundout and scored on Andrew McCutchen's two-out single to left field. Roenicke said he didn't want to put the go-ahead run on base, so he elected to pitch to McCutchen with two outs. He intentionally walked the Pirates center fielder in the 13th when Marte led off with a double, because the run meant nothing.
A fielding miscue, like Segura's, also contributed to the Brewers' early run. Schafer's excellent bunt scored Yuniesky Betancourt, who had reached with one out on Pirates shortstop Barmes' error and motored to third on the first of Maldonado's three hits.