Shaw helped Milwaukee snap a three-game losing streak of losses decided in the final at-bat by lifting 1-0 pitch from Davis (4-2) over the center field wall. It was his 31st homer of the season.
Davis had not blown save since Sept. 2, 2016 with Kansas City but allowed a game-tying home run to Orlando Arcia in the ninth inning, forcing extra innings for the third straight game.
As they did in the previous two games, the Cubs got to work quickly in the 10th as Ian Happ drew a leadoff walk off Jeremy Jeffress (5-2) then took second on a Jayson Heyward sacrifice bunt. Jay followed and worked Jeffress even at 2-2 before sending a single up the middle to score Happ and put Chicago ahead.
Davis came back out for the 10th and struck out Neil Walker to start the inning. Braun doubled to the right-field corner bringing up Shaw, second on the team this season with 30 home runs and Milwaukee's leader with 97 RBI.
Shaw took a ball from Davis to open the at-bat but Davis left a curveball up and Shaw got all of it, clinching the walk-off for a Milwaukee team desperately trying to stay alive in the NL Central race.
Milwaukee took a 1-0 lead in the first on Eric Thames' RBI single, but that would be the only run of the day allowed by Chicago starter Kyle Hendricks, who gave up eight hits and a walk and struck out six over six innings.
The Cubs tied it up in the second on Happ's RBI single to right. Like Hendricks, Brewers starter Brent Suter allowed nothing more over his 5 1/3 innings, finishing with six hits and a pair of strikeouts.
Chicago broke a 1-1 tie in the eighth on Kris Bryant's sac fly on Anthony Swarzak.
NOTES: Cubs Manager Joe Maddon says he plans to keep his rotation in order this week, with LHP Jon Lester kicking off a four-game series at St. Louis on Monday despite command problems in his last outing. "There's nothing wrong with him, ailment-wise," Maddon said. "If there was, I'd be concerned. But I'm not getting that at all," Maddon said. RHPs Jake Arrieta, John Lackey and Kyle Hendricks will follow Lester. ... Brewers C Manny Pina missed a second consecutive game because of a sprained left thumb suffered Thursday in the series opener. ... The Brewers and Cubs have split the season series, winning nine games each, and wrap it up Sunday afternoon with Chicago LHP Jose Quintana (6-3, 3.95) facing Milwaukee RHP Chase Anderson (11-3, 2.74).