Houston pounced on Ivan Nova for five runs in the first, a rally that was jump-started when Yankees center fielder Jacoby Ellsbury was unable to snag a Colby Rasmus RBI triple on a sliding attempt. Gomez, Luis Valbuena and Gonzalez also drove in runs in the frame off Nova, who lasted four-plus innings and surrendered seven runs.
Keuchel (15-6) enjoyed the support and stayed in long after it became a laugher, blanking the Bombers over seven frames for his American League-leading 15th win. He extended his franchise record by going at least six innings in his 37th consecutive start.
"It was a little difficult getting a feel the first two batters of the game, putting up a five-spot in the first," Keuchel said. "I was thankful enough to kind of get a little bit settled in. I wasn't making very good pitches. I was leaving a lot of pitches up that they were squaring up and hitting to the guys. It kind of worked in my favor today. I'd like to have a few pitches back, but kind of settled in and then found my groove toward the middle-to-late innings."
The Astros have a 4 1/2-game lead over the Rangers and a five-game lead over the Angels in the AL West. The Yankees fell a game back of Toronto in the AL East.
Gattis chased Nova by homering in the fifth, Gonzalez connected off Nick Rumbelow later in the inning and Gomez hit a three-run shot off Chris Capuano in the seventh.
"It was tough for Nova," Yankees manager Joe Girardi said. "He didn't have real good command of his fastball and his curveball, and that's a pretty tall task. We got behind Dallas, and he's an outstanding pitcher. He pitched the start of the All-Star Game, and he was outstanding again tonight."
MOMENTS THAT MATTERED Ellsbury whiffs, Nova not super: Nova recorded the first two outs of the game on just nine pitches, but the tone of the first inning was disrupted when Ellsbury attempted a sliding catch and whiffed on what was scored as a run-scoring triple for Rasmus. That opened the floodgates for a five-run frame, with Nova soaking up the pounding and pitching into the fifth. In Nova's last four starts, he is 1-3 with a 7.17 ERA (17 runs in 21 1/3 innings).
"It was not a good game today," Nova said. "It was bad that I have two bad starts in a row and I can't help the team to win games, especially this late in the season. We are fighting for a spot in the playoffs, and pitching a game like this, it doesn't help the team and doesn't help myself."
Offense breaks out: After scoring more than three runs in a game only three times in their previous 19 games, the Astros' offense broke out of its slumber. It erupted for five runs in the first inning and padded the lead on homers by Gattis and Marwin Gonzalez to equal their amount of runs they had scored in their previous five games combined.
"We needed an offensive outburst like that," Astros manager A.J. Hinch said. "The first inning, obviously, set the tone. We hadn't played a game like that in a long time, really on either side. It's obviously better to be on our side than the other side. Quite an offensive night for us. We are explosive, but we were able to get a lead and relax a little bit." More >
Tempers flare: Gomez drew some unwelcome attention after flying out in the sixth inning, flipping his bat, yelling at the ball and repeatedly telling someone on the Yanks' bench to "shut up" before benches briefly spilled onto the field. Warnings were issued to both clubs. Gomez previously had a run-in with Brian McCann when they were in different uniforms.
"I just think there was no room for that," Yankees catcher John Ryan Murphy said. "I just think in a 9-0 game -- there's never any time for that -- but I think especially in a 9-0 game, I don't think anything of that nature is called for."
"It's like, you know, be passionate, be competitive," said Gomez. "It's early in the game. We play against the Yankees, probably one of the best teams in baseball. ... Every game, every swing and every at-bat counts. I don't want to miss a pitch that I've been working really hard in the practice [to hit] and got in that at-bat, and I miss it." More >
Keuchel dominates Yanks again: Keuchel had a five-run lead when he took the mound, and he never let his foot off the gas. The lefty threw seven scoreless innings, giving him 16 scoreless innings in two starts against the Yankees this year.
"They've got a lot of guys that are professional over there and know what they're doing, and I'm lucky enough to have some good quality innings against them," Keuchel said.
POSITION PLAYER PITCHING Brendan Ryan made his first career pitching appearance, working the final two innings from the mound after starting the game at second base, then moving to right field when the score got out of hand. Ryan held Houston to two singles in his scoreless outing, during which he was clocked as high as 86 mph.
"You can't make a mockery of anything, so I just did my best to throw strikes and didn't want to walk anybody," Ryan said. "I would have loved to gotten a strikeout. I got to face my former roommate in Colby Rasmus. He swung and missed at one, so I guess I can get him with that one."
It was the longest scoreless appearance by a Yankees position player since Rocky Colavito on Aug. 25, 1968, vs. Detroit, exactly 47 years ago to the date. More >
WHAT'S NEXT Astros:Collin McHugh, looking for his 14th win of the season, will get the start Wednesday at 12:05 p.m. CT. McHugh pitched well in his last start against the Yankees, picking up the win after eight innings of one-run, two-hit ball on June 28.
Yankees: Michael Pineda will be activated from the disabled list to start Wednesday's series finale against the Astros, to be played at 1:05 p.m. ET. Pineda will be appearing for the first time since July 24, after which he was sidelined with a strained right forearm. Pineda is 0-1 with a 2.57 ERA in two career starts vs. Houston.