It took escaping a bases-loaded jam in the 1, in their landmark 4,000th regular season victory at Wrigley Field.
Rodrigo Lopez pitched six strong innings and Sean Marshall got out of trouble in the final frame, as the Cubs nipped the Astros by a run for the second time in this weekend series to hand Houston its 100th loss for the first time in franchise history.
"I think we're beyond looking at that and kind of looking at our players and what we're trying to do to get those guys better," Astros manager Brad Mills said.
Bryan LaHair smacked a solo homer in the fourth inning and the Cubs held on in a battle of poor situational hitting. The teams combined to go 0-for-22 with men in scoring position and left 22 men on base. Houston was hitless in 14 tries with RISP and stranded 13 in its third consecutive defeat.
The Cubs became just the third franchise in major league history to win at least 4,000 regular season contests in one ballpark, joining the Red Sox and Yankees.
Lopez (6-6) allowed four hits and an unearned run while fanning seven to win his second straight start.
"He's been an 80-90 pitch guy," Cubs manager Mike Quade said of Lopez. "He's had a handful of outings where he's been able to do that in games. We really needed it from him today."
Pinch-hitter Angel Sanchez singled leading off the ninth, and Clint Barmes hit a one-out double to left. J.D. Martinez was intentionally walked to fill the bases, but Jose Altuve fanned. Pinch-hitter Humberto Quintero hit a one- bouncer to second baseman Darwin Barney for the final out as Marshall recorded his fifth save.
The Cubs scored without a hit in the bottom of the inning. Tony Campana walked and moved to second on a groundout. Campana stole third and scored when Carlos Corporan's throw went into left field.
LaHair homered to center leading off the bottom of the fourth off Henry Sosa (2-5), who lasted six frames.
J.B. Shuck struck out looking to leave runners at the corners in the top of the eighth.
Cubs shortstop Starlin Castro went 1-for-4 with a double and has now reached base safely in a career-high 30 straight games. He is the first Cub to reach safely in at least 30 in a row while at shortstop since Ernie Banks reached in 30 straight games while manning the position in 1960...Chicago leads the season series, 8-6.