ST. LOUIS -- Randal Grichuk swung mightily at Adam Warren's 2-1 slider in the bottom of the ninth and came up empty.
Grichuk swung just as hard at the next slider and sent everyone home.
"I was trying to battle and get a pitch I could hit, and put good wood on it and get on," Grichuk said. "A homer was icing on the cake."
The 382-foot blast settled into the St. Louis bullpen beyond the right-center field wall, capping a late rally that improved the Cardinals to 24-21 for the year and 3-7 in games against their top NL Central rivals - the Cubs and Pittsburgh Pirates.
What's more, it might serve as a momentum boost St. Louis could use to get on a roll, according to manager Mike Matheny.
"I know it sounds pretty boring when I say one game at a time, but I'll absolutely buy into the notion that we could take off from this," Matheny said. "Sometimes, a shot like this can be the catalyst."
Grichuk's sixth homer of the year capped an evening where the Cardinals played from behind after Chicago (29-14) wiped out a short-lived 1-0 lead with two in the fourth and another run in the fifth. With starter John Lackey dealing a two-hitter through six innings, St. Louis' two-run deficit looked much steeper.
But Lackey made his one mistake of the game to pinch-hitter Matt Adams with two outs in the seventh and Yadier Molina at first, hanging a 2-1 curve. Adams lashed the chest-high offering 407 feet over the center-field wall for his fifth homer, tying the score.
"When you get a pitch like that, you've got to hit it on the barrel," Adams said.
Cardinals pinch-hitters have barreled up a lot of balls this year. It was the team's ninth pinch-homer in 75 at-bats, which leads all of baseball, and is just one shy of the franchise record of 10 set in 1998. It was Adams' sixth career pinch-homer, two off the club record held by George Crowe.
Matheny said the team's success in a pinch is related to their regular playing time. Adams, Jeremy Hazelbaker and Brandon Moss have combined for seven of the nine pinch-homers, and all see fairly consistent playing time.
"They feel like they have their timing down," Matheny said.
Warren (3-1) had retired the first five hitters he faced before Grichuk sent the Cubs to their sixth loss in eight games. However, Chicago still leads Pittsburgh by five games in the NL Central and St. Louis by six.
Manager Joe Maddon felt his team played well but just failed to come up with enough timely hits.
"Our pitchers made only one or two mistakes all night," he said. "We're playing a lot of good games and not winning."
Lackey, who was headed for his second win over St. Louis until Adams' blast, worked seven innings, giving up only four hits and three runs with a walk and nine strikeouts.
Cardinals starter Adam Wainwright pitched six innings, allowing seven hits and three runs while walking three and fanning four.
Aledmys Diaz gave St. Louis a 1-0 edge in the third with a bases-loaded sacrifice fly that scored Grichuk, but the lead didn't last long.
The Cubs erased it with two in the fourth, ending Wainwright's scoreless streak of 26 1/3 innings against them. Miguel Montero's RBI single to left-center tied it and Addison Russell's fielder's choice bouncer with the bases loaded gave them a 2-1 advantage.
Anthony Rizzo's broken-bat single in the fifth scored Kris Bryant for a two-run lead, but Chicago stranded two men in that inning and two more in the sixth.
The Cardinals' bullpen produced three scoreless innings, with Trevor Rosenthal (2-1) earning the win. With men at the corners and one out in the Cubs' ninth, Rosenthal jammed Rizzo with a 97 mph fastball, producing a looping liner that third baseman Matt Carpenter caught with a dive. He easily doubled Dexter Fowler off for a double play.
Grichuk then ended it, firing his helmet high in the air as he neared home plate and a swarming mob of teammates.
"We knew this was a big game against a good team," Wainwright said. "Even though John was throwing a great game, I felt our guys would make it happen."
NOTES: St. Louis SS Jhonny Peralta (left thumb) went 1-for-3 with a double in a rehab game at Class A Peoria Monday morning, his first hit in seven at-bats over three rehab games. ... Chicago RF Jason Heyward (rib cage contusion) missed his third straight game but is hopeful of returning to the lineup for Tuesday night's game. ... The Cubs released OF Shane Victorino from their Triple-A team in Iowa. He batted .233 in 30 at-bats and wasn't going to beat out younger reserve Matt Szczur for a spot on the bench.