The Astros could wrap up the best-of-five series with a win over the defending AL champions in Game 4 on Monday.
Keuchel, who shut down the Yankees in the AL wild-card game, worked out of jam after jam, allowing five hits and one run with seven strikeouts after going 15-0 at home this season, a modern major league record.
Photos from Game 3
Luke Gregerson gave up a leadoff homer in the ninth to Alex Gordon before finishing off the Astros first playoff game in Houston in 10 years with a four-out save. It was his first save of more than three outs in three years.
Jason Castro drove in two runs with a single in the fifth that made it 2-1. Carlos Gomez, who has a rib muscle strain, started for the first time in the series and had an RBI single in the sixth.
Carter's soaring solo homer, which landed on the train tracks atop the wall in left-center, and came on Danny Duffy's first pitch of the seventh pushed the lead to 4-1.
Carter, batting .199 in the regular season but .455 in the postseason, was a triple shy of the cycle for the Astros, who were hosting a playoff game for the first time since the 2005 World Series.
Lorenzo Cain hit a solo homer in the fourth for the Royals, who are on the brink of elimination after reaching the World Series last season.
Kansas City starter Edinson Volquez fell to 0-3 in his postseason career by allowing five hits and three runs in 5 2-3 innings.
The Astros are one win away from reaching the AL championship series just two years after losing a franchise-worst 111 games. They took the series lead in front of a rowdy, playoff-starved sellout crowd of 42,674. The group was mostly clad in orange and dotted with fans sporting fake beards in support of the star lefty who has become all but untouchable at home.
They were given inflatable orange sticks at the door and spent the afternoon beating them as they cheered, making the roar in the closed-roof stadium deafening at times.
Keuchel wasn't as sharp as he was in New York, but he was able to tiptoe out of trouble again and again and got deep in the game despite a pitch count that got high early. He finished with a season-high 124 pitches.
The Astros scored three runs in the first two innings of both of the first two games, but couldn't get anything going early on Sunday.
Colby Rasmus, who homered in Houston's first three playoff games, got a kooky single in the eighth when his pop fly caromed off the ceiling and back into play.
The Astros' first hit didn't come until a single by Carter to start the third inning, but he was thrown out trying to stretch it into a double. Luis Valbuena drew a walk with one out in the fifth and Carter followed with the team's second hit, a liner to the left-field corner for a double. Castro got hit first hit of the postseason on two-strike groundball to center field to score them both to make it 2-1.
George Springer doubled to start Houston's sixth when Cain sprinted and dived to grab his flyball, but it bounced in and out of his glove and onto the ground. Cain slid across the warning track on his stomach and punched the wall in frustration when he got back to his feet.
Gomez's two-out single to center field scored Springer to extend the lead to 3-1.
Cain's first career homer in the postseason came when he launched the 10th pitch of the at-bat, a hanging 80 mph slider, into the seats in left field to start the fourth inning and make it 1-0.
PRESIDENTIAL FIRST PITCH
Former President George H.W. Bush, in a wheelchair and wearing a neck brace, threw out the ceremonial first pitch before the game. The 91-year-old Bush, recovering after breaking a vertebra in his neck in a summer spill, smiled broadly when the crowd cheered after he was brought onto the field. With wife Barbara by his side, he bounced a short throw from about five feet in front of the plate to Houston's Jed Lowrie, who was set up to catch.
Houston rookie Lance McCullers (6-7, 3.22) opposes Yordano Ventura (13-8, 4.08) in Game 4. It will be the postseason debut for McCullers, who turned 22 on Oct. 2. But he seems undaunted by the challenge. "I don't view myself as a young kid when I go out there," he said. Ventura will make his second start of the series after his first one was limited to two innings because of a 49-minute rain delay in Game 1. He was strong late in the regular season, going 7-1 with a 2.38 ERA in his last 11 starts.
Tweets from the game:
The Associated Press contributed to this report.