Marcum (13-7) gave up only one run on five hits while striking out seven without walking a batter. Francisco Rodriguez came on in the ninth to finish off the Cubs.
"I just wanted to get back to what I was doing my last two starts," Marcum said. "It's nice to get the win, but more important to go out and get back to locating all my pitches and keeping everything down in the zone."
Rickie Weeks knocked in a pair, Corey Hart came up with a run-scoring double, and Nyjer Morgan added two hits, two runs scored and an RBI for the Brewers, who bounced back after dropping the opener of the series.
Milwaukee's magic number to clinch the National League Central division crown stands at three.
Randy Wells (7-5) gave up five runs on six hits over five innings while fanning three and walking two. It was Wells' first loss since July 28, when he was also beaten by the Brewers.
The Brewers opened the scoring in the third inning and stayed in front for good, plating four runs. Marcum ripped a one-out double and came around to score on a double by Hart. Hart was then brought home on a single into left field by Morgan. Morgan swiped second and moved to third on a Geovanny Soto miscue. Ryan Braun followed by knocking home Morgan with a single up the middle. After a groundout by Prince Fielder, Weeks ripped a single into left to score Braun.
Milwaukee added another run in the fifth, which Morgan began with a single. He moved to second and then third on consecutive wild pitches before hustling home on a groundout by Weeks to make it 5-0.
The Cubs finally got on the board in the sixth when Castro led off the frame by blasting an offering from Marcum just over the wall in left-center to account for the final margin.
"Marcum was really good tonight," Cubs manager Mike Quade said. "Just down, down, down. He didn't make many mistakes."
Milwaukee improved to 4-1 on its current six-game road swing...Castro has reached base safely in 33 consecutive games...Chicago Bears Hall of Fame running back Gale Sayers sang "Take Me Out To The Ball Game" during the seventh-inning stretch...Tuesday's game marked the final night start of the season at Wrigley, and the Cubs finished 11-18 in those contests...The win gives Marcum 50 in his major league career.