Updated

After a tough stretch of starts, Brandon McCarthy was determined to turn things around on Wednesday night.

Things didn't go the way McCarthy and the Diamondbacks had hoped in a 5-1 loss to the Houston Astros.

Chris Carter homered twice and Dallas Keuchel pitched eight strong innings to lead the Astros to the victory.

McCarthy (1-9) allowed eight hits and four runs in six-plus innings to remain winless since May 3. He lamented the fact that Arizona has lost his last three starts in large part because he's been outpitched in them.

"We have seen (Julio) Teheran, we've seen (Johnny) Cueto, we've seen really good starters," McCarthy said. "Once we are down to them, they kind of keep us there. He just falls in line with that. It's tough, and it's especially tough for me know that I have to be the guy to suppress it the best that I can. You feel like you have let everything down."

Keuchel (8-3) won for the sixth time in seven starts. He allowed four hits and a run, striking out five and lowering his ERA to 2.38.

Carter's first solo home run made it 3-1 in the fourth inning, and he added an opposite-field shot in the seventh. It was the fifth career multihomer game for Carter and second this year.

Carter has struggled this season and is batting just .199, but his power is undeniable and he's tied for the team lead with 12 homers.

Aaron Hill homered in the fourth for Arizona's only extra-base hit.

"We have to score," Diamondbacks manager Kirk Gibson said. "We have great batters all around. We weren't able to do so. We have to move on. Their guy threw a good game against us."

George Springer had two hits and an RBI and fellow rookie Jon Singleton drove in a run as the Astros won for the fifth time in seven games.

McCarthy has had success in Houston in the past and entered the game 2-0 with a 0.60 ERA in his career at Minute Maid Park.

But the Astros got going against him early, with Springer singling in the first, Singleton drawing a walk and Jason Castro grounding an RBI single. Singleton was thrown out at third on the play.

Jonathan Villar singled to start Houston's third before a one-out single by Springer. Both players advanced on a wild pitch by McCarthy before Villar scored on a groundout by Singleton to make it 2-0.

"I wasn't sharp from the get-go, but I thought I did a good job to get as deep as I could," McCarthy said. "The seventh inning there. The home run hurts and the guys getting on after that hurts and kind of spoils everything."

The Diamondbacks didn't get a hit until Hill led off the fourth with his homer to the Crawford Boxes in left field to cut the lead to 2-1.

Paul Goldschmidt singled after Hill's homer, but Keuchel got back on track after that and retired 13 of his next 14 batters. The only hit in that span came on a single by Chris Owings with one out in the sixth inning.

Ender Inciarte singled with two outs in the Arizona eighth, but Keuchel retired Owings to end the inning and Keuchel's night.

Springer drove in a run with a sacrifice fly in the seventh inning.

NOTES: The series wraps up on Thursday when Arizona's Wade Miley opposes Scott Feldman. ... Houston 2B Jose Altuve missed his first game of the season because of soreness in his oblique muscle. Manager Bo Porter said Altuve didn't want to take the day off and tried to convince him to let him play. ... Diamondbacks OF Gerardo Parra was out of the lineup for a scheduled day off.