CHICAGO -- Zach Davies' work between starts resulted in a big payoff Wednesday.
"I worked on some things between starts, and it translated," Davies said. "A little of it was game plan, going after hitters, attacking them and making sure I'm not losing strikes down in the zone and making sure that I'm making them swing."
Davies (2-2) allowed two hits, walked one and struck out four.
"It was a great performance, I think a real confidence-builder for him," Milwaukee manager Craig Counsell said. "I think a night like tonight when he does what he's good at, it works. He knows that he's got weapons to get major league hitters out."
Right-handed reliever Francisco Rodriguez worked a perfect ninth inning for his 35th save.
Chicago starter Kyle Hendricks (7-7) took his first loss since Aug. 26 despite an improved effort. He gave up three runs on four hits in six-plus innings. Hendricks struck out eight without issuing a walk.
"It felt so much better making pitches," Hendricks said. "My fastball command started out pretty good, and that helped me find my lane, which is what I've been searching for."
The Brewers (64-88) snapped a two-game losing streak. The Cubs (89-63) saw a two-game winning run end.
Hendricks retired 14 straight Milwaukee batters through 4 2/3 innings, allowing just one ball to the outfield, before the Brewers ended the shutout.
Shortstop Jean Segura beat out a two-out infield base hit, stole second and came home for a 1-0 lead on third baseman Luis Sardinas' single to shallow left.
"I thought he was really good," Cubs manager Joe Maddon said. "He threw the ball really well, good life on the fastball, changeup was outstanding."
Milwaukee first baseman Adam Lind launched a leadoff double to the left field wall in the seventh and scored on left fielder Khris Davis' first-pitch base hit to right-center that made it 2-0.
Hendricks was pulled after that for right-handed reliever Justin Grimm.
Grimm loaded the bases with one out for Brewers catcher Martin Maldonado, whose one-out sacrifice fly to left brought home Davis for a 3-0 lead. Davies was pulled for pinch hitter Jason Rogers, who walked to again load the bases.
Cubs left-handed reliever Zac Rosscup prevented more damage, as pinch hitter Hernan Perez grounded to third to close the inning.
Chicago right-fielder Jorge Soler broke the shutout in the bottom of the seventh with his 10th homer of the season. He hit a towering solo shot to left on a first pitch off Milwaukee left-handed reliever Will Smith.
Maldonado made it 4-1 in the ninth with a two-out single down the third base line to score Santana from third.
NOTES: INF Yadiel Rivera made his major league debut Tuesday as a defensive replacement, becoming the eighth Brewers player to appear in his first big league game this season. ... Milwaukee opens a seven-game trip Thursday with the first of four in St. Louis. The Brewers send RHP Taylor Jungmann (9-6, 3.31 ERA) against Cardinals RHP Michael Wacha (16-6, 3.08). ... Brewers 1B Adam Lind already has his fifth 20-home run season, and he needs just four RBIs for his second 90-plus RBI season. ... Cubs 1B Anthony Rizzo and 3B Kris Bryant are neck-and-neck with big stick production. Rizzo has a 30-26 lead in homers, and Bryant has a 98-95 lead in RBIs. ... The Cubs are idle Thursday -- their final scheduled off day during the regular season -- before they host the Pirates for three games starting Friday in a showdown for the first National League wild-card spot. ... The Pirates send RHP Gerrit Cole (17-8) against Cubs LHP Jon Lester (10-11) in the opener. Chicago RHP Jake Arrieta (20-6) goes for another win in Sunday's series finale.