Moustakas has been off to a tough start this season and was hitting .098 before his solo shot to the seats in right field off Jerome Williams (0-1) to lead off the 11th.
A small group of Royals fans stood and yelled `Moooooose' as he rounded the bases after his first homer this year.
Jarrod Dyson singled and added an insurance run on a fielder's choice.
The 24-year-old, who hit 37 homers combined in Double-A and Triple-A last season, singled and walked, but struck out with one out and a runner on first in the 11th.
The Astros went 0 for 6 with runners in scoring position and left 12 men on base.
Eric Hosmer had two hits for his fourth multi-hit game. He led the American League last season with 60 such games.
Lorenzo Cain and Alcides Escobar singled with one out in the seventh inning and Hosmer walked with two outs to load the bases. A sharp groundball single by Perez off Matt Albers rolled just out of reach of a diving Marwin Gonzalez and into left field to score two and tie it at 4-4.
The homer by Krauss put Houston up 4-2 in the sixth inning.
Alex Gordon drew a one-out walk in the fourth inning before a single by Valencia. Dallas Keuchel plunked Justin Maxwell on the right hand to load the bases and Gordon scored on a groundout by Cain to tie it at 2-2.
Springer got his first major league hit on a dribbler that traveled just a few feet down the third base line with one out in the third inning. His parents were sitting behind home plate and his mother stood up and waved her hands in the air when he reached first base. Castro's opposite field homer to left field followed to put Houston up 2-1.
Valencia's shot to the Crawford Boxes in left field gave Kansas City a 1-0 lead in the second inning.
Springer drew a leadoff walk in the fifth inning, but was caught stealing in a rundown later in the inning.
Hosmer made a nifty play on a grounder Matt Dominguez hit off the end of his bat for the second out in the eighth inning. He grabbed it on the run backhanded and flipped it to pitcher Kelvin Herrera, who was covering first.
NOTES: Cain was initially credited with a single to start the ninth inning, but Houston manager Bo Porter challenged the call and officials found he didn't beat the throw. ... Right-hander Brad Peacock will take Lucas Harrell's spot in the Astros rotation. Harrell was designated for assignment on Wednesday after starting the season 0-3. ... LHP Bruce Chen has been scratched from Thursday's start for Kansas City because of a sore back. RHP James Shields will start in his place in the finale against Scott Feldman. Chen should be able to start on Saturday.