Albert Almora Jr. had three hits and the bullpen was stellar as the Cubs took two of three in the weekend series.
Baez's homer to right field in the fourth -- his 13th -- came on a low cutter on the outside edge of the plate, a fact not lost on manager Joe Maddon.
"If you watched him in batting practice, he was killing it to the right side of the field," Maddon said. "If he can just stay with that mentality all the time, there's no telling how good he can be at the plate."
Chatwood walked five and allowed three runs in 2 2/3 innings. The right-hander leads the NL with 45 walks, including six in his previous start against Cleveland, when he allowed four runs in 2 2/3 innings. Chatwood is 3-4 with a 4.10 ERA in the first season of a $38 million, three-year contract he signed in December.
"I'm grinding right now, for sure," he said. "But the good thing is we won the game."
Left-hander Randy Rosario (1-0) replaced Chatwood and escaped a bases-loaded jam. The rookie -- promoted from the minors Saturday -- allowed one hit in 2 1/3 innings for his first major league win.
San Francisco starter Ty Blach (3-5) also struggled, allowing five runs on seven hits in three-plus innings. He walked four and struck out three.
"He's a guy that goes after them and throws strikes," Giants manager Bruce Bochy said. "He was just off."
After San Francisco took a 1-0 lead on two walks and two infield hits, Mac Williamson hit a two-out, two-run single to right to make it 3-0 in the first.
The Cubs quickly tied it with three runs in the bottom half.
Kris Bryant delivered a one-out run-scoring double. Anthony Rizzo followed with a liner up the middle. The ball hit off Blach's glove and struck second base umpire Cory Blaser before rolling slowing towards first base as Bryant scored all the way from second.
After Kyle Schwarber singled to right to put runners on the corners, Addison Russell hit a grounder up the middle. Again, Blach got a glove on it but couldn't make the play, giving Russell a tying hit.
After Baez provided a 6-3 lead with his homer off reliever Pierce Johnson -- he now leads the NL with 42 RBI -- Chicago added two more in the fifth on an RBI, pinch-hit single by Tommy La Stella and an RBI double by Almora.
Chatwood will remain in the rotation even though Maddon acknowledged the problem is mental.
"When he's out on the mound, he's trying so hard just to throw a strike or not walk somebody -- and that's the issue," the manager said. "He's got to get beyond that, because if that's your focus, sure enough you're gonna walk somebody or you're not gonna throw a strike."
Alex Rodriquez, part of the ESPN crew broadcasting the game from the right-field bleachers, led the seventh inning stretch and was loudly booed by the Wrigley Field crowd.
Giants: LHP Madison Bumgarner (broken left pinky) tossed 3 2/3 scoreless innings Saturday night in a rehab start for Triple-A Sacramento. He threw 47 pitches and had eight strikeouts. ... C Buster Posey (sore right hip) missed his second straight game. Bochy said Posey may play Monday.
More AP baseball: https://apnews.com/tag/MLBbaseball
Yelich: 'Unbelievable feeling' being named NL MVP
Christian Yelich joins SportsCenter after being named the National League MVP and receiving 29 of 30 first-place votes.
Newly crowned MVP Mookie Betts staking a claim as MLB's best player
Winning baseball's biggest award adds an exclamation point: There might be nothing that Boston's right-field star can't do on the diamond.
Yankees GM: Hustling 'always a prerequisite,' but won't discuss Manny Machado
While saying that hustling "is always a prerequisite" when signing players, Yankees GM Brian Cashman doesn't want any part of a debate about free agent Manny Machado
Brewers' Christian Yelich beats out Nolan Arenado, Javier Baez for NL MVP award
Brewers slugger Christian Yelich topped fellow finalists Nolan Arenado of the Rockies and Javier Baez of the Cubs for the National League MVP award Thursday.
Mookie Betts beats Mike Trout, Jose Ramirez to win American League MVP
Mookie Betts couldn't draw up a dream season much more perfect than this: a batting title, a 30/30 campaign, a World Series championship and now the American League MVP award.
Marlins get rid of orange, cite South Florida cultures with new look
The Marlins are going with blue, black, red and gray as their colors for 2019, and the team's new logo has a font style and colors reminiscent of the 1950s Miami Marlins.