The victory was the Cubs' fourth straight as Chicago (81-66) extended its NL Central lead to four games over the Cardinals with 15 to play. St. Louis (77-70) dropped its second in three games.
Cardinals starter Carlos Martinez (11-11) took the loss after giving up seven runs in a 5 1/3-inning outing.
Jon Jay had two hits for the Cubs while Stephen Piscotty recorded a pair for the Cardinals.
Tommy Pham gave the Cardinals an early 1-0 lead with his 21st homer of the season. The one-out shot to left came on a first pitch off Lackey in the opening inning.
After Chicago piled up 39 runs, including 14 on Thursday, in this week's three-game sweep of the New York Mets, Martinez retired 10 straight Cubs until the fourth inning.
Bryant ended the shutout with his 27th homer, a one-out solo shot to center field to force a 1-1 tie.
Rizzo overran home plate, however, and was out as Pham threw to catcher Yadier Molina for the inning-ending out.
Martinez helped his cause with a run-scoring single to right-center moments after home plate umpire Jordan Baker called a ball on an apparent third strike. Kolten Wong came home for a 2-1 Cardinals lead.
Wilson struck out Matt Carpenter to end the inning.
Lackey allowed two runs on three hits in his shortened 4 2/3-inning outing. He struck out four and walked two while throwing 74 pitches.
Chicago took command with a seven-run sixth that chased both Martinez and reliever Matt Bowman.
The Cubs had two runners on and none out when Avila singled home Bryant to force a 2-2 tie. Jay came up with one gone and drove in Rizzo with a base hit for a 3-2 advantage.
That was all for Martinez, who departed with two runners on bases for Bowman.
Bowman gave up a two-run single to Ian Happ, scoring Jay and Heyward. Zobrist's sacrifice fly to center brought home Baez while Bryant's single to left-center delivered Happ for an 8-2 lead.
Martinez gave up seven runs on six hits while striking out five.
NOTES: St. Louis 2B Kolten Wong left Fridays game in the bottom of the fifth with lower back tightness. ... Following Friday's start, Cardinals RHP Carlos Martinez is now two away from making 100 career starts. ... SS Paul DeJong's next homer will give him 23, good for second all-time among rookies in Cardinals single-season history. ... The Cardinals send RHP Michael Wacha (12-7, 3.99 ERA) against Cubs RHP Kyle Hendricks (6-5, 3.35) in Saturday's middle game. ... The Cubs have scored 754 runs, second only to Washington 755 atop the National League. ... Ten of Chicago's final 15 regular season games are against teams .500 or better. A total of 13 are against NL Central foes, a run broken by a two-game series at Tampa Bay on Sept. 19-20.