Christian Yelich smacked his 44th home run of the season and four pitchers combined on a three-hitter to lift the host Milwaukee Brewers to a 7-1 victory against the Chicago Cubs on Friday night.

Brewers right-hander Zach Davies scattered one run and three hits with one walk and four strikeouts in five innings to earn the victory. Davies (9-7) yielded to Brent Suter, Junior Guerra and Ray Black, who teamed for four innings of no-hit, one-walk, three-strikeout relief.

Despite the loss, Chicago remained 2 1/2 games behind the first-place St. Louis Cardinals in the National League Central, as the visiting Cardinals lost 9-4 to the Pittsburgh Pirates earlier Friday.

Milwaukee, meanwhile, moved within four games of the Cubs for the second wild-card spot in the National League.

The Cubs took a 1-0 lead on right fielder Nicholas Castellanos' two-out home run in the third inning. The blast was Castellanos' 13th in 33 games with the Cubs. Castellanos, who later doubled, hit 11 homers in 100 games with the Detroit Tigers to start the season before joining Chicago at the July 31 trade deadline.

Milwaukee answered swiftly in the bottom half, as Yelich blasted a 3-2 pitch from Cole Hamels over the fence for a three-run shot after Lorenzo Cain and Yasmani Grandal opened the inning with singles. The Brewers added another run later in the inning when Cory Spangenberg's squeeze bunt with runners on the corners scored Tyler Austin.

Grandal smacked a solo homer in the fourth to put the Brewers ahead 5-1. Orlando Arcia's run-scoring sacrifice fly in the seventh and Ben Gamel's RBI single in the eighth accounted for the final margin.

Hamels fell to 7-6 after allowing five runs and nine hits in 3 1/3 innings with two walks and three strikeouts. The Cubs' bullpen yielded one hit the rest of the way.

Yelich paced the Brewers' attack with three hits, while Grandal added two.

The Cubs went 0-for-4 with runners in scoring position.