NEW YORK — Scott Feldman hit all his spots for eight enchanting innings. Oliver Perez missed them all while facing just three batters.
"These are exciting games. I wish we would have one," manager A.J. Hinch said after the AL West leaders dropped to 19-21 in one-run decisions.
"One-run games are tough losses but you'll see tomorrow that we're a resilient team," he added. "We'll bounce back and be better."
Perez (0-1) entered in the ninth and gave New York fans a reminder of his wild five seasons with the Mets. He walked Brett Gardner, threw a wild pitch, then walked Alex Rodriguez intentionally. Brian McCann walked to load them and end Perez's night.
"I watched the tape and I threw pretty good pitches, but I think they were taking all the way because in this stadium, you have to be down in the zone and I threw a lot of sliders close so they could swing at it, but they took it," Perez said.
Beltran then gave Chad Qualls' first pitch a ride to deep center field for New York's third walk-off win this year.
Andrew Miller (2-2) allowed a single to Evan Gattis to open the ninth, but McCann threw out pinch-runner Jake Marisnick trying to steal second on a strikeout.
Houston lost for the 18th time in 22 road games. The Astros were coming off a sweep of the Los Angeles Dodgers at Minute Maid Park.
Feldman matched Nathan Eovaldi, the hard-throwing right-hander from Houston, in a tense matchup.
"Honestly, these type of games at the end of the year, we're in a pennant race obviously, so you want to put up a zero no matter what," Feldman said. "Just about anybody who we've been playing, they're going to come at us with their 'A' game so better to put up zeroes whenever you can."
Feldman pitched eight innings for the first time since Sept. 18, 2014. He allowed six hits and struck out six without a walk.
Eovaldi yielded just four hits and struck out seven with a fastball that reached 101 mph. He walked three over eight innings.
"He was filthy," McCann said of Eovaldi. "He did whatever he wanted tonight."
The Yankees had a chance to score in the seventh but center fielder Carlos Gomez and catcher Hank Conger teamed up to cut down a runner at the plate.
McCann led off with a single and Beltran hit a sharp line drive off the wall in right field to put men at first and third with none out.
Greg Bird struck out, then Chase Headley hit a fly to center. McCann tried to tag, but Gomez made a strong throw that reached catcher Conger on three skips. Conger caught the relay as he was falling to his knees and reached in front to tag a sliding McCann for the double play. Conger pumped his fist and shouted as he sat near home plate.
"He made a pretty good slide, sliding on the inside but it was a great throw," Conger said.
Astros: OF George Springer (broken right wrist) took early batting practice, his first BP since getting hurt July 2. "It was good to see him on the field," Hinch said. "I joked with him he looked like a real player again." Springer will hit again Tuesday and probably on Wednesday before deciding on how soon he plays rehab games. ... Hinch said Jed Lowrie's hand is fine, and that the infielder was due an off-day Monday.
Yankees: 1B Mark Teixeira (bruised right shin) was out for his seventh straight game. He's starting to feel better, though, in all aspects except running. "The running is still a little bit of a struggle," he said. ... LHP CC Sabathia was put on the 15-day DL with right knee inflammation. There's no timetable for his return.
PLENTY OF REST
Mike Fiers' next start after Friday's no-hitter is scheduled to come Saturday in Minnesota, giving the right-hander seven days' rest. He threw 134 pitches in his first no-no.
Astros: LHP Dallas Keuchel (14-6) might be the best-suited pitcher in baseball for homer-friendly Yankee Stadium. He leads the majors with a groundball-to-flyball ratio of 4.53. He shut out New York in Houston on June 25.
Yankees: Ivan Nova (5-5) is coming off a loss to Cleveland in which he allowed three runs and six hits in a season low-tying five innings. He's only faced the Astros once, in his first start last season. Three starts later, the right-hander's year was over due to Tommy John surgery.