Updated

HOUSTON -- The Los Angeles Angels aren't where they want to be yet, but they're closer than they were at the start of the week.

David Freese hit a go-ahead two-run double in a three-run eighth inning to help the Angels rally for a 6-5 win over the Astros on Wednesday to gain ground in the AL wild-card race.

Los Angeles took two of three in the series and is 1 1/2 games behind Houston for the second AL wild-card spot.

"We're staying focused, know what we need to do, don't try to force it, just do our job and win series," slugger Albert Pujols said.

The Astros are 2 1/2 games behind AL West-leading Texas, which played later Wednesday in Oakland.

The Astros took their first lead of the game in the seventh, and the Angels trailed 4-3 entering the eighth. Mike Trout hit a leadoff double off Will Harris (5-5) before David Murphy drew a walk with one out, and Harris was replaced by Pat Neshek.

Freese's double sailed just beyond left fielder Colby Rasmus' reach on the warning track and made it 5-4.

"I started praying that the juice box was small enough for it to go off the wall," Freese said, using a nickname for Minute Maid Park. "But yeah, I clipped it, and it just went far enough out of reach of Rasmus. So it ended up being good for us."

Carlos Perez's RBI single made it 6-4 and chased Neshek.

Trevor Gott (3-2) induced the last two outs of the seventh for the win, and Huston Street allowed one run in the ninth before retiring Jed Lowrie for his 40th save.

"We're playing a lot better baseball as we made the turn into September than we did in August," manager Mike Scioscia said. "I think that's important. We're doing a lot more things ... that hopefully are going to put the game on our terms and then give us a chance to hold leads."

George Springer had three RBIs and Carlos Correa added two for the Astros, who are heading into a pivotal weekend series with Texas.

"We're taking a few body blows this month and we'll respond favorably, we always have," manager A.J. Hinch said. "It doesn't make tonight any easier, but we'll dust ourselves off and we know we have a big series ahead and we know we'll need to play well to win."

C.J. Cron drove in two runs in the first for the Angels, and Kole Calhoun hit a solo homer in the fifth.

Houston trailed 3-2 entering the seventh before pinch-hitter Matt Duffy legged out a single with one out and was replaced by pinch-runner Jake Marisnick. The Angels intentionally walked Jose Altuve with two outs before a triple by Springer to right field off Gott scored them both.

Houston starter Mike Fiers yielded four hits and three runs in 6 2-3 innings.

Nick Tropeano, who was traded to the Angels from Houston this offseason, allowed four hits and two runs with five strikeouts in 4 1-3 innings.

TRAINER'S ROOM

Astros: OF Carlos Gomez (intercostal strain) missed his 11th straight game. Hinch said he isn't sure when Gomez will be able to hit again, but that he could be used as a defensive replacement or pinch runner soon.

FAMOUS BEARDS

Bearded Houston Rockets star James Harden, who finished second in MVP voting in 2015, threw out the ceremonial first pitch on Wednesday to Astros ace Dallas Keuchel, owner of the second most famous beard in Houston. Harden met and took pictures with Trout before the pitch and posed for pictures with Keuchel after it. He was asked what he thought about Keuchel's beard. "That's my fellow bearded brother," Harden said.

UP NEXT

Angels: The team is off on Thursday before RHP Garrett Richards (14-11, 3.73) opposes Seattle's Felix Hernandez (18-9, 3.54) in the first of three games against the Mariners. Richards, who has a career-high 14 wins this season, is 1-2 with a 3.96 ERA in four starts against Seattle this year.

Astros: Houston is also off on Thursday and opens a series with Texas on Friday when Scott Kazmir (7-10, 2.73) opposes Rangers RHP Yovani Gallardo (12-11, 3.41). Kazmir is 1-5 with a 3.70 ERA in his last 10 starts.