Updated

Bronx, NY (SportsNetwork.com) - Chris Carter's 30th home run of the season was a game-winner.

Carter struck out in his first four at-bats, then launched a three-run shot in the top of the ninth inning Tuesday night to lift the Houston Astros to a 7-4 win over the New York Yankees in the opener of a three-game series.

Carter's no-doubt-about-it blast off David Robertson (1-4) landed two sections deep behind left field to break a 4-4 tie after Robbie Grossman and Jose Altuve both walked.

"I know he throws a lot of strikes and has been having a lot of success," said Carter. "I was just trying to get the pitch I wanted and put a good swing on it."

Chad Qualls pitched the bottom of the ninth to earn his 14th save for the Astros, who have won three of their last four games.

The Yankees had won their last two games against Tampa Bay on the road on the heels of a season high-tying five-game losing streak. They got a two-run homer from Brian McCann and a game-tying two-run double from Martin Prado in the sixth inning.

"I know I've said it before but we've got to play better," said Yankees outfielder Brett Gardner. "We've got to do more offensively and play better with the lead."

Chris Capuano remained winless in five starts since New York acquired him from Boston last month. The left-hander, who pitched on his 36th birthday, was charged with four runs on eight hits and two walks in 5 1/3 innings.

He had eight strikeouts but couldn't make it out of the sixth, when the Astros scored three runs to take the lead sparked by Dexter Fowler's leadoff triple.

Fowler scored on a groundout to tie the game before Matt Dominguez and Jon Singleton knocked Capuano out with consecutive singles. They later came home on a pinch-hit single from Marwin Gonzalez, giving the Astros a 4-2 lead.

In the bottom of the sixth, Jacoby Ellsbury singled, Carlos Beltran walked with one out and Prado drilled a 3-2 fastball into the left-field corner to tie the score at 4-4 and chase Houston starter Brett Oberholtzer.

Ellsbury singled off Josh Fields (3-6) in the eighth, stole second base and took third on Jason Castro's bad throw. But he broke for home with one out on Beltran's sharp grounder to the shortstop Gonzalez and was tagged out easily. Prado singled, but Fields escaped the inning on McCann's fly ball.

Houston's Gregorio Petit had the game's only extra-base hit -- a ground-rule double in the third inning -- before McCann's second-deck blast in the fourth.

Petit doubled in the fifth and scored on Grossman's bloop single to right to get the Astros within 2-1.

Game Notes

Carter was named AL Player of the Week on Monday after clubbing four homers and batting .321 last week. His previous career high was 29 home runs last season ... Oberholtzer struck out seven and gave up seven hits and a walk ... Grossman hit the top of McCann's catcher's helmet with his bat after swinging through a third strike to end the top of the sixth inning. McCann, who came off the seven-day concussion list on Sunday, jogged off the field apparently unfazed ... Capuano hasn't won a game as a starter since Aug. 3, 2013, for the Dodgers against the Cubs. New York is 1-4 in his starts ... The Yankees started a six-game homestand ... The Astros improved to 3-2 on a 10-game road trip.