After St. Louis put up two quick runs on a triple off David Carpenter, Myers had to quickly warm up.
|More on Cardinals-Astros|
|More MLB coverage|
He then allowed a full-count, two-run homer to Rafael Furcal that closed the gap to one run before settling in to shut down the Cardinals and help the Astros hold on for a 9-8 win.
After the homer, Myers retired Carlos Beltran before walking Matt Holliday, but Allen Craig grounded out to give Myers his 14th save.
"It was quick. I threw like nine pitches in the `pen and I wasn't ready at all," he said. "But that's the way the game goes sometimes, you've just got to go out there and try to grind through it. It worked out for us tonight."
Justin Maxwell hit a two-run homer and Jose Altuve tied a career high with four hits as the Astros got to St. Louis starter Jaime Garcia early to build a big lead.
The Astros scored four runs in the first inning and Maxwell's homer in the second stretched their lead to 6-1. Brian Bogusevic added a solo home run in the fourth and Chris Snyder drove in two runs for Houston.
Garcia (3-4) yielded five hits and the six runs tied his season high, set against the Astros earlier this season. The loss drops the left-hander to 0-5 in seven career starts against Houston. He has allowed at least three runs in each of those starts.
It was the shortest start of the season for Garcia, who was scratched from his last start with a sore elbow. He was replaced by Maikel Cleto for the third inning.
Afterward, Cardinals manager Mike Matheny conceded that Garcia wasn't himself.
"He's not right," Matheny said. "We had given him some thorough examinations, and we were confident that he would be ready to go, but he obviously wasn't."
Garcia said the velocity on his fastball has been down, but couldn't pinpoint exactly what the problem was.
"I wish I knew what was wrong," he said. "I would have fixed it a while ago."
Houston starter Lucas Harrell (5-4) allowed eight hits and four runs -- three earned -- in six innings to improve to 4-0 in five home starts this season.
Adron Chambers drove in two runs with a one-out triple off Carpenter in the ninth inning to get St. Louis within 9-6.
Matt Adams had a three-run homer in the third inning for the Cardinals, who have lost six of their last seven.
Furcal reached second base on a two-base error by Altuve to start the game. He scored on a two-out groundout by Holliday to make it 1-0.
Altuve doubled and scored on a two-out single by J.D. Martinez to tie it at 1-1 in the first. Chris Johnson and Brett Wallace drew consecutive walks to load the bases before Martinez scored on a wild pitch.
Snyder's two RBI single to left field extended Houston's lead to 4-1.
Garcia finally got out of that inning when Bogusevic grounded into a forceout.
Maxwell's two-out homer, which was his second home run in his last three at-bats, sailed into the Crawford Boxes in left field and put Houston up 6-1. His last home run came on a two-run shot Sunday as a pinch hitter. Altuve singled with one out to set up the homer which was Maxwell's fifth of the year.
"We did a good job of putting some runs up early, and we needed every single one of them tonight," Maxwell said.
Craig singled with two outs in the third before a double by David Freese. Adams followed with his homer to the deepest part of the ballpark in center field to get St. Louis within 6-4.
Bogusevic's homer, which bounced off the foul pole in right field, came in the fourth to push Houston's lead to 7-4.
Altuve doubled with two outs in the sixth inning and made it 8-4 when he scored on an error by rookie reliever Sam Freeman.
Back-to-back doubles by Johnson and Wallace added a run for the Astros in the seventh inning.
Cardinals 1B Lance Berkman, who has been rehabbing in Houston since undergoing right knee surgery on May 25, was in the St. Louis clubhouse before Tuesday's game. He said he's making progress, but doesn't expect to be back on the field until July. He plans to stay in Houston until at least June 15, when he has a checkup with the doctor who performed the arthroscopic surgery. ... Houston CF Jordan Schafer was out of the starting lineup on Tuesday because of an illness. ... The series continues on Wednesday when Houston's Bud Norris opposes Adam Wainwright.