The rest of the Chicago Cubs kept their cool.
Bryant went deep in the fourth and singled twice in Chicago's seven-run sixth, helping the NL Central leaders open a big weekend series on a winning note.
The Cubs stayed three games ahead of Milwaukee and increased their advantage over St. Louis to four games. The Brewers rolled to a 10-2 victory over Miami on Friday night.
Lackey and Contreras were thrown out with Chicago trailing 2-1 in the fifth. But after outscoring the New York Mets 39-14 in a three-game sweep, the defending World Series champions got enough big hits to improve to 9-4 against the Cardinals this year.
"It takes a special group to do that," outfielder Jason Heyward said. "You've got to have experience to be able to deal with that kind of moment."
The Cardinals had runners on first and second with two out in the fifth when the short-tempered Lackey screamed at plate umpire Jordan Baker after he called a ball on a 2-2 pitch to Martinez near the knees and outside corner.
Martinez said through an interpreter that he also thought it was strike three. Instead, he lined the next pitch for an RBI single, giving St. Louis a 2-1 lead, and the 38-year-old Lackey yelled at the umpire again as he ran toward the plate.
Contreras also got into it with Baker. He slammed his mask, which bounced up and grazed the umpire, and he had to be restrained by manager Joe Maddon.
Lackey said Baker missed a pitch and threw him out "half-heartedly because he knew he messed up."
"Love to see us be able to add on a little bit more right there," Matheny said. "Looking for that big hit once again and opportunities to go after their bullpen and try to add to a small lead. But we always know these games can go one way or the other hurry in this place."
Lackey, meanwhile, expressed no regrets about getting ejected.
"It's a pretty big spot right there," he said. "It cost me a big league win. Those don't grow on trees."
Don't expect the 38-year-old Lackey to change to change his ornery ways. Maddon doesn't.
"Why would I even think that? That's the definition of insanity," he said. "Why would I think he's going to change in that particular moment? So God bless him."
A contrite Contreras, meanwhile, insisted he wasn't trying to hit Baker.
"I apologize to everybody," he said. "To the fans. To MLB. To the umpire. ... Other than that, I'm just happy that the team was able to come back and win the game."
Tommy Pham homered for St. Louis . But the Cubs chased Carlos Martinez in the sixth, sending 11 batters to the plate and grabbing an 8-2 lead.
Bryant led off with a single and scored. He also drove in the final run with a single , making it 8-2.
Lackey gave up three hits in 4 2/3 innings. Carl Edwards Jr. (4-4) pitched a perfect sixth for the win.
Martinez gave up seven runs and six hits in 5 1/3 innings.
Cardinals: 2B Kolten Wong departed with tightness in his lower back. He was lifted for a pinch hitter in the seventh. ... CF Dexter Fowler (bruised knee) remained sidelined. ... RHP Adam Wainwright (right elbow) is expected to throw a bullpen session Saturday.
Cubs: SS Addison Russell hopes to return this weekend after being sidelined since Aug. 2 because of plantar fasciitis in his right foot. Russell is scheduled to work out Saturday. ... RHP Jake Arrieta (strained right hamstring) is scheduled to throw a bullpen session.
The Cubs send RHP Kyle Hendricks (6-5, 3.35 ERA) to the mound while the Cardinals go with RHP Michael Wacha (12-7, 3.99 ERA).
More AP baseball: https://apnews.com/tag/MLBbaseball
Copyright 2017 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.