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
Pinch-hitter Chris Herrmann's two-run homer in the 11th inning gave the Seattle Mariners a 10-8 win over Oakland on Tuesday night, clinching the AL West for Houston and leaving the Athletics with a wild-card matchup against the New York Yankees.
Dodger Stadium again this season is ranked as one of the most pitcher-friendly parks in the National League.
Pitcher Madison Bumgarner had the first game-ending hit of his career, a pinch-hit single in the 12th inning that drove in Gorkys Hernandez, and lifted the San Francisco Giants to a 5-4 victory over the San Diego Padres on Tuesday night.
Andrew McCutchen breaks down the play where he went back racing to make a catch and took a tumble on the turf at Tropicana Field.
Adrian Beltre has played some of the best baseball of his 21-year career against the Los Angeles Angels, and the Texas Rangers third baseman seems to enjoy hitting off left-hander Andrew Heaney just as much.
Knotted at 8-8 in the 11th, Chris Herrmann connects on a two-run home run to send the Mariners to a 10-8 win over the Athletics.