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
Adam Wainwright pitched two-hit ball over six innings for his first win in five months, Marcell Ozuna homered and the St. Louis Cardinals salvaged the finale of a four-game series with a 5-0 victory over the Los Angeles Dodgers on Sunday night.
The Philadelphia Phillies and New York Mets start their final series of the season Monday night at Citizens Bank Park with the Phillies are still clinging to slim playoff hopes and the Mets playing their best baseball since April.
The rivalry between the Toronto Blue Jays and the Baltimore Orioles has been lopsided this season.
Adam Wainwright strikes out 9, allowing only just two hits over six scoreless innings.
At age 35, Justin Verlander is having one of his finest seasons and has been at his best when the Astros need him most.
Christin Stewart, a September call-up, is getting a chance to play regularly as the Detroit Tigers' season winds down.