Houston, TX (SportsNetwork.com) - Evan Gattis and Luis Valbuena hit back-to- back homers to cap a five-run third inning, and the Houston Astros held on to beat the Baltimore Orioles 6-4 on Tuesday.

Houston starter Collin McHugh (6-2) rebounded nicely after giving up four runs in the second. The right-hander allowed six hits while striking out six and walking two over seven innings.

Mike Wright (2-1) gave up five runs on eight hits over five innings for the Orioles, who have lost four in a row.

Baltimore jumped out to a 4-0 lead in the second. Delmon Young reached on a fielder's choice, moved to third on Jimmy Paredes' single and scored on Steve Pearce's single to right-center field. Ryan Flaherty followed with a two-run triple to center and raced home himself two batters later on Manny Machado's two-out single.

"Anytime we get four runs, especially in one inning, I've got to keep that lead," Wright said. "I can't let it all happen in that one inning. Any time an offense can score four runs, we should win the game."

Houston left the bases loaded in the bottom half when Marwin Gonzalez grounded into a double play.

The Astros went ahead for good with a five-run third. George Springer, Jose Altuve and Preston Tucker hit three straight singles to plate a run. Gattis followed with a three-run homer and Valbuena added a solo shot to make it 5-4.

"There have been good comebacks, (we've) come back from a lot. I'm just glad we could get him (McHugh) some runs and we've got a potent offense," Gattis said.

The home team tacked on an insurance run in the eighth. Valbuena and Chris Carter walked to start things. Valbuena moved to third when Hank Conger flied out and scored on Gonzalez's grounder to first.

McHugh did not give up a hit after the second. Pat Neshek tossed a perfect eighth and Luke Gregerson tossed a scoreless ninth for his 15th save of the season.

Game Notes

Astros catcher Jason Castro sat out with a bruised right knee ... O's shortstop J.J. Hardy missed his second straight game with a sore left oblique.