DENVER -- Miles Mikolas had some pitches he'd rather have back. His swing was a keeper.
O'Neill also had an RBI double and Kolten Wong added three hits and a sacrifice fly for the Cardinals in a game between teams in the thick of their respective division races and running 1-2 in the NL wild-card race. It was also St. Louis' ninth win in a row on the road.
"(Mikolas) hit one earlier in the year and we knew he was going to probably run into another one at some point," said Bud Norris, who got three outs for his 27th save, capping 4 1/3 innings of scoreless relief by the Cardinals' bullpen. "Obviously, that swing helped us win a ball game and definitely was doing your part on the offensive side, too."
The Rockies pulled within two runs with a five-run fifth that featured a two-run drive by Charlie Blackmon and a solo shot by Nolan Arenado, both off Mikolas, who helped St. Louis take a 7-0 lead by hitting a two-run homer as part of a four-run second.
Mikolas had stranded five base runners over the first four innings but could not get out of the fifth.
He was relieved by Chasen Shreve after Carlos Gonzalez scored from third on Ian Desmond's fielder's choice and Ryan McMahon hit a two-out RBI single that drove in Desmond, who had reached third on second baseman Wong's throwing error.
"They got hold of two bad breaking balls, but other than that, I thought all the other contact that inning was pretty soft, a couple bloopers, seeing-eye singles stuff, like that," Mikolas said. "I'll beat myself up over those breaking balls but other than that they got a couple of hits that weren't so good."
Besides, he can take some solace in the difference his home run made in the game.
"I've got the juice right now for our pitching staff, so that's nice. That's something that will help me go to bed tonight," said Mikolas, also tipping his cap to the bullpen for picking him up.
Carlos Martinez (7-6) picked up the victory with 1 2/3 innings of hitless relief.
Norris gave up a two-out double to Ryan McMahon and walked pinch-hitter Chris Iannetta before retiring D.J. LeMahieu on a fielder's choice for the final out.
"The game got ugly earlier, but we didn't give up," Gonzalez said. "We put some runs (up). We scored five that inning to put us back in the game. But they also pitched well. Their bullpen came in and shut us down."
Leading off the second, O'Neill drove a 1-2 offering from Antonio Senzatela (4-4) deep into the left-field bleachers for his fifth home run of the season, marking the 16th straight game in which the Cardinals homered. The streak is the longest since St. Louis connected in a club-record 25 straight games in 2016.
Jedd Gyorko worked a one-out walk and Wong singled before Senzatela struck out Harrison Bader. But after Gyorko scored from third on a passed ball, Mikolas homered over the wall in straightaway center for his second of the season. The right-hander also homered for his first big league hit April 2 at Milwaukee.
"He got the ball up and they made him pay," Rockies manager Bud Black said of Senzatela. "He didn't really have any consistent secondary pitches tonight. Probably too many mistakes and just really couldn't string any pitches together all night."
The Cardinals added three runs in the fifth, moving out to a 7-0 lead on run-scoring doubles by Gyorko and O'Neill and a sacrifice fly by Wong.
Cardinals: RHP Michael Wacha threw 3 2/3 scoreless innings Thursday night in his second rehab start for Class A Palm Beach against Fort Myers. He's expected to throw a bullpen session Sunday before making a third rehab start on Tuesday, most likely at Class AA Springfield. Wacha went on the 10-day disabled list June 21 with a left oblique strain. "He's in the conversation to come back and pitch in early September but what day that looks like -- he's not there yet," interim manager Mike Shildt said.
Cardinals: RHP John Gant (5-5, 3.76 ERA) has posted a 2.30 ERA over his last three starts spanning 15 2/3 innings. He is making his first career appearance against the Rockies.
Rockies: RHP German Marquez (11-9, 4.42 ERA) is set to make his third career start against the Cardinals but first in more than a year. He won his previous outings against St. Louis, both at Coors Field, going 2-0 with a 2.53 ERA over a combined 10 2/3 innings.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports
A blockbuster offseason move for all 30 teams
Want to make a hot stove splash? Start with these bold trades and free-agent additions.
Athletics' Bob Melvin nabs AL Manager of the Year honors
Oakland Athletics skipper Bob Melvin was named American League Manager of the Year on Tuesday after guiding the team with the lowest Opening Day payroll in baseball to a 97-65 record and its first playoff berth in four years.
Brian Snitker is NL's top manager after leading Braves to East title
After leading the Braves to an unexpected National League East title, Brian Snitker has been named NL Manager of the Year. The Brewers' Craig Counsell and Rockies' Bud Black finished second and third, respectively.
Did Ohtani deserve Rookie of the Year?
Around the Horn discuss whether Shohei Ohtani deserved Rookie of the Year even though he only played 104 games this season.
MLB to investigate claims of racial discrimination vs. Mariners
MLB said in a statement provided to The Athletic that it will investigate allegations of racial discrimination in the Seattle Mariners organization made by a former employee.
Wins don't tell story of Jacob deGrom's fabulous season
If the Mets ace wins the NL Cy Young Award on Wednesday -- as he should -- we'll know for sure that judging pitchers' performance has entered a new age.