Hammel had a season-high seven strikeouts. He didn’t allow a hit until Carlos Gomez doubled with one out in the sixth.
Hammel then got into trouble after walking Scooter Gennett and making an errant pickoff throw to put runners at second and third. But the righty got a strikeout before Aramis Ramirez bounced out to end the threat.
Chicago scored twice in the second on Castro’s first homer and Darwin Barney’s RBI fielder’s choice with the bases loaded. Castro’s second shot in the eighth barely cleared the wall in the left-field corner.
Brewers starter Wily Peralta allowed eight hits in seven innings.