NEW YORK — As the outs piled up, the little voice in Derek Holland’s head kept getting louder.
‘‘You can execute this pitch! You can throw it!’’ the Texas lefthander told himself, over and over. ‘‘You’re going to make this pitch!’’
He certainly did.
Holland tamed a team that has often tagged him, tossing a two-hitter as the Rangers finished up an impressive road trip by beating the New York Yankees, 2-0, Thursday at Yankee Stadium.
How special was this performance? Not since Seattle’s Matt Young in 1983 had a visiting lefty blanked the Yankees on two or fewer hits.
‘‘You think positive thoughts,’’ Holland said. ‘‘You can’t let any negativity get in there.
‘‘I haven’t had great success against these guys. They’ve destroyed me.’’
Holland began the game 0-5 with an 8.85 ERA against the Yankees in regular-season play. He had shown a glimmer of success, however, in the postseason, going 1-0 and throwing 5⅔ shutout innings against them in the 2010 AL Championship Series.
Holland (6-4) threw his sixth career shutout — it was the lowest-hit shutout by a visiting Rangers pitcher against the Yankees since the Texas franchise moved from Washington for the 1972 season.
Jurickson Profar homered and scored twice, while fellow rookie Engel Beltre got the first two hits of his big league career. Texas went home leading the AL West after going 5-1 on its swing to St. Louis and New York.
The 26-year-old Holland struck out struck seven, walked two, and didn’t give up a hit after the third inning. His 92-pitch performance produced his first win in five starts.
A leadoff single by Ichiro Suzuki in the first and a two-out single by Austin Romine in the third were the lone hits off Holland. New York managed a one runner after a leadoff walk in the fourth.
The Yankees went 4-5 on their homestand against the Dodgers, Tampa Bay, and Texas.
‘‘Struggling right now. We talked about that a little bit,’’ Yankees manager Joe Girardi said.
The Yankees hit a few fly balls that were caught on the warning track, and left fielder David Murphy contributed a sliding grab. Backup catcher Geovany Soto helped, too, when Robinson Cano tried to advance on a ball in the dirt in the seventh and was thrown out at second base.
Otherwise, it was all Holland.
‘‘I thought his fastball and slider were pretty effective today. He was ahead of our guys all day and seemed to pound the strike zone,’’ Girardi said.
Phil Hughes (3-7) pitched well, yet has won once in his last eight starts. He allowed five hits in eight innings after getting seven days’ rest.
The 20-year-old Profar, rated among the top prospects in baseball, led off the fifth with his third home run of the season.
Texas also scored following an unusual play in the third. Murphy opened with a single and took off a full-count pitch as Profar took a checked-swing. Romine, the catcher, made a strong throw to second, Murphy was tagged and wandered off the bag, thinking he was out.
Plate umpire Gerry Davis checked with third base ump Mark Carlson, who ruled that Profar held up his swing and that it was ball four. Murphy was entitled to second on the walk, but was out because he walked off the bag on his own and was tagged again.
Beltre followed with a perfect hit-and-run, a day after being caught stealing as a pinch runner in his major league debut. Ian Kinsler’s sacrifice fly drove in Profar to make it 1-0.
Beltre added an infield hit, to the delight of family members in attendance. The Rangers acquired Beltre from the Red Sox as a 17-year-old as part of the Eric Gagne trade in 2007.