Keuchel (4-4) allowed nine hits and walked just one while giving up more than two runs in a start for the first time since May 26.
"I felt good out of the 'pen, even with the long rain delay," Keuchel said. "They touched me up for two solos first at-bats in the fourth and the fifth. Other than that, I felt pretty good and kept the team in the game."
Following that rain delay of three hours and 18 minutes before the start of the game, both starting pitchers came out throwing strikes and mowing down hitters.
Cubs starter Matt Garza (2-1) faced just three over the minimum through the first six innings, needing 65 pitches over that span. Of the three batters to reach base, two came with two outs and nobody on base. Garza allowed just one run on four hits with eight strikeouts in his eight-plus innings.
Keuchel worked out of minor trouble in the first and third innings, retiring six straight batters at one point between jams.
Cubs first baseman Anthony Rizzo ended the scoreless duel when he led off the fourth inning with a long home run down the right-field line and over the bleachers onto Sheffield Avenue on the first pitch.
Solo homers would become a theme for Keuchel. Darwin Barney, the Cubs' light-hitting second baseman, led off the fifth with a line-drive homer to left-center, and right fielder Scott Hairston followed with a blast with one out in the sixth to make it 3-0.
"The first one to Rizzo was just a fastball down the middle," Keuchel said. "It was supposed to be away. He put a good swing on it. The one to Barney was a 1-2 pitch I believe, and he hit a slider down and in. I left a few sliders up today."
The Astros finally got on the board in the seventh when Chris Carter led off with a line-drive homer on a 94-mph fastball into the right-center-field bleachers to trim the deficit to 3-1.
"When you line drive a ball to the opposite-field gap like that, you have to really square it up," Astros manager Bo Porter said.
The blast was Carter's club-leading 15th of the season, but the slugger has gained more attention for his Major League-leading 105 strikeouts. Despite the issues, Porter has stuck with Carter as an everyday player.
"We see the power potential and understand that when it clicks and comes together, we have something really special," Porter said. "We will stick with him, and he knows what he's capable of doing, and the adjustments that [hitting coach] John Mallee's making with him day in and day out -- we see the results and we're starting to see him drive the ball the other way.
"I told him the other day, 'You start driving the ball like that the other way, they're gonna have no choice but to come back to the middle-third of the plate.' And that's where he can do some real damage."
On this night, though, Carter was the only Astros player to break through. Garza avoided further damage in the seventh inning and then struck out the side in the eighth. He started the ninth, but was lifted after walking Jose Altuve to lead off the frame. Closer Kevin Gregg came on for his 11th save.
"I feel like everything is coming back, slowly but surely," said Garza, who was making just his seventh start of the season after he was injured in Spring Training. "Everybody would like it a lot faster, but as long as it comes back, I'm not worried about it."
After getting off to a dreadful start this season, the young Astros (28-47) are 13-10 in their last 23 games even after Friday's loss, and Porter sees progress due to all the close games of late.
"When you're playing a lot of tight games, that means you're doing a lot of things well to keep yourself in the game, and it gives you opportunities to win some great points," he said. "Today we didn't win enough great points to come away with the game, but take nothing away from our ballclub. They fought and clawed and made it a game to the point where they had to get their closer in the game."