Not bothered by a 50-minute rain delay in the middle of the second inning, Karstens threw four perfect innings, retiring the first 12 batters he faced on just 41 pitches, before Prince Fielder lifted a first-pitch fastball over the wall in left for an opposite-field home run, his 23rd of the season, in the fifth inning.
Rickie Weeks broke a 1-1 tie an inning later, smacking a 3-0 two-seamer to left with a runner on to put the Brewers ahead to stay in the sixth.
Karstens was charged with three runs on three hits over six innings, striking out six. Fifty-three of his 66 pitches went for strikes. The Pirates lost at home for the first time in five games this season with Karstens as their starter.
"I just felt I had a really good rhythm throwing strikes," Karstens said. "And then when I got ahead I was expanding the zone a little bit, making them chase. Just doing what I've been doing while I've been here."
After their bats erupted for 17 and 19 hits on Saturday and Sunday, respectively, the Pirates were held in check offensively for much of the night, notching just six hits. Missing leadoff hitter Andrew McCutchen -- day-to-day with a sprained AC joint in his right shoulder -- for just the third time in the center fielder's young career, the Pirates were led by Neil Walker and Ronny Cedeno, who each went 2-for-4 and now have three consecutive multihit games.
Cedeno's two-out triple off Chris Capuano in the fifth, his first of the season, drove home Pedro Alvarez for the Pirates' only run, tying the score at 1.
"Just you relax at home plate, you know what I mean?" Cedeno said. "Get a good approach, good 'AB' and see the ball, hit the ball. That's all I do right now."
Four Pirates relievers held the Brewers hitless over the final three innings.
Capuano, who has undergone two Tommy John surgeries, was quietly effective for the Brewers, striking out four through five innings and allowing just three hits.
More importantly, the left-hander recorded his first win since May 7, 2007.
"The time since my last win definitely wasn't lost on me," Capuano said. "It was a really nice gift from the team. There were some hard-hit balls I gave up, and they played great defense. I left four innings for the 'pen to eat up. So it feels really good, and I really appreciate it from my team."
The Pirates threatened off John Axford in the ninth. Garrett Jones led off with a single, and Alvarez followed with a walk. But Ryan Doumit went down swinging, Ryan Church looking, and the red-hot Cedeno grounded out to second to end the contest.
Lastings Milledge hit a fourth-inning double to extend his hitting streak to seven games.
Karstens had come closer to perfection before, on Aug. 6, 2008, at Arizona, where he shut down 23 straight D-backs over 7 2/3 innings. The right-hander was efficient Monday, but the Pirates' bats -- despite outhitting the Brewers 6-3 -- were not.
"He threw the ball really well," Pirates manager John Russell said of Karstens. "He was attacking the zone down, throwing a lot of strikes. The ball to Fielder just got flat up. He got behind Weeks and just didn't make his pitch there. Talking to him and Ryan [Doumit], those were really the only two mistakes he made. Unfortunately he had to pay for it. But Jeff threw the ball very well. He was sharp, the ball was down. The rain delay didn't affect him very much. It was good to see."