OAKLAND -- Even when the Astros' young bullpen stood up and rose to the challenge Tuesday night, it didn't do it without providing some intense drama and frayed nerves.
The Astros' relief corps, which has struggled mightily the last two weeks, survived a furious late rally by the A's -- and missed giving up a walk-off home run to Chris Young by inches -- to survive for a 5-4 win at O.co Coliseum that snapped a six-game losing streak.
On the pitch after Young thought he had won the game with a fly ball that missed hitting the left-field foul pole by inches -- a call that was upheld after the umpires reviewed the play -- Astros reliever Chia-Jen Lo struck out Young swinging to end the game.
"We definitely needed that one there," Astros manager Bo Porter said. "Sitting from our dugout, it looked foul. But anytime they go in to review it, you're not too sure. It definitely was foul, and I'm glad Lo was able to close it out."
The Astros had blown six of their seven previous save opportunities, all of which had come since they traded closer Jose Veras to the Tigers two weeks ago. It was the first Major League save for Lo, who threw 1 1/3 scoreless innings.
"I think it was not only big for our ballclub, but I think it was big for our bullpen, as well," Porter said. "The woes we've had, to have those guys get through tonight and get some big outs is huge."
The Astros entered the eighth inning with a 5-1 lead after starter Jordan Lyles (5-6) threw seven innings and allowed five hits and one run to get his first win since June 18, breaking his personal five-game losing streak and nine-start winless stretch.
The A's scored three times after there two outs with no one on base in the eighth against Josh Zeid, capped by a two-run homer by Yoenis Cespedes that cut the lead to 5-4 and had nearly everyone in Astros orange and blue thinking the worst.
"I actually felt confident tonight," Porter said. "I felt like we were going to get it done. Even though they put on a good rally to get within one, once we got Lo in the game and we got out of the eighth inning, I felt like he was going to go back out and close it out."
Lo walked Stephen Vogt with one out in the ninth following an 11-pitch battle before getting Eric Sogard to fly out to deep right field. That brought up Young, the Houston native who has feasted on Astros pitching throughout his career.
Young crushed an 0-1 pitch and sent it down the left-field line, only to watch it curl just outside the pole. Young put his hands on his head in disbelief, thinking he had won the game. A's manager Bob Melvin stormed on the field and asked the umpires to look at the replay.
"That was very nerve-wracking for me and a couple of guys in here," Lyles said. "It's much more nerve-wracking to watch a game you started once you have no control over it."
Young swung through an 0-2 curveball on the next pitch.
"I thought it was going to stay true," Young said of his near game-winner. "I thought it was close. From my point of view, I thought it was fair. I just appreciate the umpires going to check it out. That's all you can ask for. If it's foul, it's foul. Just go look at it and get it right, and they got it right. We were inches away from winning that game."
Brandon Barnes went 2-for-4 with a two-run double in the second inning, and Jason Castro went 1-for-3 to extend his hitting streak to 11 games. He had a sacrifice fly in the third inning to help the Astros build a 4-0 lead.
Barnes led off the fourth with a double, went to third on a single by L.J. Hoes and scored on a double play to give Lyles a 5-0 cushion. A's starter Bartolo Colon (14-5) was 3-0 with a 1.89 ERA in three previous starts against the Astros this year, allowing four earned runs in 19 innings.
"The first couple of times, you're still trying to figure him out," Barnes said. "As young guys, we had never really faced him before. We knew he was going to throw a sinker to a side of the plate and go from there."
Lyles, who had a career ERA of 11.16 in the fifth inning entering Tuesday, got himself in trouble in the fifth by allowing a leadoff triple to Josh Donaldson and walking Seth Smith. But it took him only three pitches to escape by getting Vogt to hit into a double play that scored a run, and getting Sogard to ground out.
"That was big," Lyles said. "That's been my story the last couple of years, around that inning. Early triple and then walk the next guy. The next pitch is up under the zone and he swung over it and we got a double play, and that was big. Sometimes, you don't get out of that and it leads to bigger innings, but we were able to do that."