CHICAGO (AP) -- The Cubs finally caught a break.
Matt Garza pitched nine strong innings and Marlon Byrd 's 12th-inning dribbler was ruled fair, giving him an infield single and lifting Chicago to a 4-3 victory over the Houston Astros on Friday.
"We don't do anything the easy way around here," manager Mike Quade said of the Cubs, who were coming off an 11-inning loss in Cincinnati on Thursday night.
Starlin Castro set up the winning rally with a leadoff walk, went to second on Darwin Barney 's sacrifice, and moved to third on a wild pitch. He scored when third baseman Chris Johnson couldn't handle Byrd's dribbler up the line.
"I think I set a record for the shortest walk-off hit ever," Byrd said.
The Astros argued that Byrd's hit should have been a foul ball and replays suggested they were correct.
"I was right over top of it, so I had a really good look," Johnson said. "Once I saw it hit foul I just tried to make contact with it because the ball's dead, you know? ... We'll just move on. People make mistakes."
Garza was one strike from finishing off a five-hitter when Carlos Lee hit his second home run of the game, a two-run shot into the left-field bleachers that tied it 3-all. Garza said he decided to challenge Lee with a fastball.
"It is what it is, man," Garza said. "It's one of those situations where I said, 'Here's my best. What do you got?' He guessed right and beat me.
"I knew where I had to put that pitch for him not to hit it. I just left it up the middle and he got it."
Nevertheless, it was a solid outing for Garza, who struck out four and threw a season-high 124 pitches, allowing seven hits and no walks. Jeff Samardzija (7-4) threw a scoreless 12th to pick up the win and send the Astros to their 99th loss.
Before this season, Houston had never lost more than 97 games in the franchise's 50-year history.
"They're tough losses, but on the other hand, you have to look at the positives," Lee said. "We're playing good baseball. We're playing good games."
Geovany Soto led off the third with his 15th homer, and Aramis Ramirez had three hits, including his first triple since July 9, 2010.
"(Rodriguez) left me a fastball right there and I put good wood on it," Soto said.
Lee had three hits and three RBIs for Houston. He opened the scoring with a solo blast leading off the second. Lee has hit in 22 of his last 24 games, and has 23 career homers at Wrigley Field, third among active players.
"I would say since the All-Star break, I've been feeling pretty good," Lee said. "I've found a position where I feel real comfortable and I'm seeing the ball real good."
Astros starter Wandy Rodriguez allowed three runs and six hits over 5 2-3 innings, striking out five and walking four. He is two strikeouts shy of becoming the first Astros lefty to record 1,000 in a career. Reliever David Carpenter (0-3) gave up the winning run.
The Astros swung early and often against Garza, who faced the minimum in five different innings and no more than four until the ninth. After allowing J.D. Martinez's leadoff single in the fourth, Garza retired the next 13 Astros in order.
"For the main part, (Garza) threw the ball unbelievable today," Soto said.
The long game was bad news for a Cubs squad weary after Thursday night's four-hour defeat. The Cubs were tired, but mustered enough energy to mob Byrd after his game-winner.
"They had plenty of energy, punching me in the stomach," Byrd said. "I just held my ground. We felt pretty good today. It's one of those things, we got in late but you have to get up for every game."
Notes: Castro went 0 for 4 with two walks and remains seven hits shy of becoming the youngest Cub to reach the 200-hit mark. ... The Cubs opened their homestand Friday afternoon after finishing their road trip with the extra-inning loss at Cincinnati on Thursday night. It's the kind of scheduling crunch Quade would like to avoid given the ordinance that requires the Cubs to play day games on Fridays. "I don't know if it's a doable deal, but obviously you'd like to play a day game somewhere else before coming home," he said. ... Actor Martin Sheen performed during the seventh-inning stretch, singing "Take Me Out to the Ballgame." ... The Astros will send Henry Sosa to the mound on Saturday to face Chicago's Rodrigo Lopez .