NEW YORK (AP) Booed relentlessly by angry fans for two days during losses in the Bronx, Jose Altuve was speaking with Astros manager Dusty Baker before Houston's series finale against the New York Yankees, a game played on the day the All-Star infielder turned 31.

''He says, it would be really nice if I hit a home run every birthday, Mother's Day and Father's Day,'' Baker recalled.

And so Altuve did. And not just any home run.

Altuve hit a go-ahead, three-run homer off Chad Green in the eighth inning, and the Houston Astros beat the Yankees 7-4 Thursday to avoid a three-game sweep.

''It quieted the fans,'' Baker would say with a pause - ''for a little while, anyway.''

Gleyber Torres also stood out, with an an incredible, daring dash for the Yankees in which he scored from first base on an infield single. But Houston stopped New York's five-game winning streak and got back over .500 at 16-15.

Altuve had been 4 for 22 on May 6 with a double and a triple on his birthday, but never with a long ball.

He singled leading off to set the tone against former teammate Gerrit Cole, who allowed solo homers to Yordan Alvarez in the fourth and seventh and turned a 3-2 lead over to Green (0-3) starting the eighth.

Green started his own trouble by walking Kyle Tucker leading off. Pinch-hitter Aledmys Diaz reached on a single to Gio Urshela, who made a diving stop but threw past first for an error that allowed Tucker to take third.

Martin Maldonado struck out to bring up Altuve, a target of fans expressing their anger directly at the Astros since the exposure of their cheating scandal en route to the 2017 World Series title. That run included a seven-game win over the Yankees in the AL Championship Series.

Altuve said the crowd reaction made it difficult to maintain focus.

''You don't like to get booed by anybody but that's part of the game,'' he said.

Altuve had been 1 for 11 with no RBIs in the series when he worked the count to 3-2. Green was struggling with his command all inning.

''That inning should never even get to Altuve,'' Green said.

Altuve's second home run this season, coming on Green's 18th pitch, brought teammates Alex Bregman and Carlos Correa out of the dugout to congratulate him. It was a rare stumble for the Yankees bullpen, which entered with a major league-best 2.24 ERA.

''That was on time. I mean, he couldn't have scripted any better,'' Baker said.

Baker went over to Altuve on the bench and put his hands on his shoulders, congratulating him for connecting.

''I know it meant a lot to us in the dugout to see him hit that homer,'' said starter Lance McCullers Jr.

After Torres pulled the Yankees within a run in the bottom half, M aldonado hit a two-run homer off Justin Wilson in the ninth, ending a streak of of 75 plate appearances without an RBI.

Torres' frenetic eighth-inning sprint came after he noticed the Astros shifted to the right side. Correa knocked down Aaron Hicks' grounder behind second but had no play as the ball trickled just onto the outfield grass.

Correa recovered quickly, but Torres saw third uncovered and kept on going. Maldonado left his catcher's spot and ran to cover third, while reliever Ryan Pressly stayed on the mound.

Correa then made a short toss to Bregman, the third baseman who was near second, and Torres ran through third-base coach Phil Nevin's stop sign, racing home ahead of Maldonado. Torres tumbled headfirst across the plate without a throw.

''I saw the pitcher stay on the mound,'' Torres said. ''I just kept running.''

Alex Scrubb (1-0) pitched a perfect seventh, and Pressly got six outs for his fifth save in five chances, inducing Giancarlo Stanton to ground into a game-ending double play.

Stanton crushed a 117.3 mph solo home run off an ad hanging above the Yankees bullpen in right-center in the third inning, and slumping Clint Frazier hit a tiebreaking, two-run homer in the fourth off McCullers for a 3-1 lead.

Cole faced the Astros for the first time since leaving after the 2019 World Series for a $324 million deal with the Yankees and exchanged a hug with McCullers before the game.

''He looks good in navy blue,'' McCullers said. ''It brings out his eyes.''

After striking out 62 in his first six starts, Cole didn't have his best fastball and fanned just four in seven innings. He walked none for his fourth start in a row and allowed five hits.

''I felt like I played chess out there for a couple hours,'' Cole said. ''There was a different level of intensity, certainly.''

CORNER

Aaron Judge struck out his first two times up and matched his career worst of strikeouts in seven straight at-bats before grounding out twice.

TRAINER'S ROOM

Astros: Maldonado was back in the starting lineup, two days after he bruised his left trapezius (by neck and shoulders) during a home plate collision with Rougned Odor. ''Probably the scariest play I've ever been involved in my big league career,'' said Maldonado, who reported remaining a little stiff. ... RHP Jake Odorizzi (right pronator muscle strain) threw a 25-pitch bullpen session Wednesday and likely will have another bullpen before a minor league rehab assignment.

Yankees: Urshela left in the eighth inning, shortly after making his diving stop and bad throw. He sent for an MRI on a knee. ... RHP Luis Severino is to throw to batters on Tuesday or Wednesday, his first time facing hitters since Tommy John surgery on Feb. 27 last year.

UP NEXT

Astros: RHP Jose Urquidy (2-2) will be on the mound when the Astros start a homestand Friday against Toronto.

Yankees: RHP Jameson Taillon (1-2) starts a series opener against Washington and LHP Patrick Corbin (1-3) on Friday after beating Detroit last weekend for his first win in exactly two years.

More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports

Copyright 2024 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.