HOUSTON — Down two starting infielders, the Astros did one thing they have struggled to do this season — finish off the Rangers.

Jose Altuve and Alex Bregman both left with injuries, but George Springer and Teoscar Hernandez homered and the Houston Astros helped their fading playoff hopes with an 8-4 win over the Texas Rangers on Wednesday night.

“I really like the way we fought back, even after they scored the run in the first,” Houston manager A.J. Hinch said. “We keep fighting and we finished tonight’s game a lot better obviously.”

Altuve exited after the fourth with right oblique discomfort, and Bregman was pulled in the sixth with right hamstring discomfort.

Neither player was available to speak after the game.

“They’re getting looked at, getting all the tests,” Hinch said. “They’re going to have a full evaluation before we know anything. I’m not optimistic about Friday for either one of them.”

Houston snapped a three-game losing streak and closed within 3 1/2 games of Toronto for the second AL wild card.

Hernandez gave the Astros a 3-1 lead with a two-run homer off the facade in left-center in the second. Springer led off the first with his 27th home run to tie it at 1.

The Astros got just their fourth win in 19 games against the Rangers this season.

“It feels good to beat these guys,” Houston starter Joe Musgrove said. “We have put up tough battles and given everything we had, and they have found ways to sneak out wins in the later innings. To have an offensive burst in the later innings like that, is nice.”

After the Rangers closed within 5-4, Marwin Gonzalez hit a two-run single and Jake Marisnick had an RBI single in the eighth to extend the lead to four.

“I was just trying to put the ball in play with a flyball or whatever,” Gonzalez said.

Musgrove (3-4) allowed three runs and five hits with seven strikeouts in 6 1/3 innings. The rookie right-hander retired 14 of 15 batters at one point.

“It’s always easy to pitch when you have some runs on the board,” Musgrove said. “It gives you the freedom to challenge guys a little more and attack guys in the zone.”

Derek Holland (7-8) allowed five runs and seven hits in 5 1/3 innings. Holland lost his second straight and has given up at least four runs in each start.

“It looked like he seemed to fight himself in the delivery a little bit,” Texas manager Jeff Banister said. “Once he settled in I thought he threw some quality pitches, got some quality outs. Really I think the toughest part is three of the four inherited runners of our bullpen we allowed those to score. We can’t have that.”

The left-handed Holland was announced as the starter after Tuesday night’s game, with original starter Yu Darvish moved to start Saturday.

INJURED INFIELDERS

Altuve entered leading the AL in hitting with a .340 average to go with 24 home runs and 94 RBIs. The second baseman also leads the AL in hits with 196. He was 1 for 2 with a double before being lifted.

Bregman, a rookie third baseman batting .260 with eight homers, limped into third in the sixth inning after stopping and starting on Tyler White’s groundout. Bregman tried to walk it off, but he was lifted for pinch-runner Tony Kemp and limped off the field.

SUPER UTILITY MAN GONZALEZ

Gonzalez played three positions while the banged-up Astros shuffled their infield. He started out at first base, moved to second base following Altuve’s exit and then went to third base following Bregman’s departure. After the seventh, Gonzalez moved back to second. Gonzalez has also played shortstop and in the outfield this season.

SPRINGER TIES BIGGIO

Springer got his eighth leadoff homer of the season, tying Craig Biggio for the club record, which the Hall of Famer set in 2001.

UP NEXT

Rangers: LHP Cole Hamels (14-5) makes his 30th start of the season Friday night against Oakland. The left-hander allowed two runs in six innings in his last start Saturday against the Angels.

Astros: RHP Collin McHugh (10-10) makes his 30th start of the season Friday in Seattle looking for his fourth straight win. McHugh is 8-3 with a 4.39 ERA in his career against the Mariners, including a 3-0 record this season with a 1.50 ERA.