A mostly unknown veteran pitcher with a funny name and almost no big-league track record to speak of bewildered the Yankees Saturday afternoon.

Rangers righthander Austin Bibens-Dirkx, a 32-year-old career minor-leaguer making his fourth major-league start, was terrific in his seven innings, sending the Yankees to an 8-1 loss in front of an irritated crowd of 40,225 at the Stadium.

Other than Aaron Judge’s major league-leading 26th home run, which made it 3-1 in the sixth inning, the Yankees (40-32) again were quiet at the plate in losing for the ninth time in their last 11 games.

“Just seemed like he stayed off the barrel of the bat with his sliders, changeup and cutters,” Joe Girardi said of Bibens-Dirkx. “We weren’t able to really square him up today.”

Bibens-Dirkx entered the game 2-0 with a 4.25 ERA this season and had been 1-0 with a 4.86 ERA in three previous starts. With an assortment of off-speed stuff and a fastball that sat in the range of 89 to 91 mph, Bibens-Dirkx — who beat Max Scherzer on June 11 in his second start — allowed one run, five hits and a walk.

The Yankees put only two runners in scoring position against Bibens-Dirkx, as Mason Williams walked in the first, singled in the third and stole second each time.

advertisement | advertise on newsday

“He was mixing his pitches,” said Tyler Austin, called up after Chris Carter was designated for assignment early Saturday morning. “He was putting the ball where he wanted to, for the most part.”

Aaron Hicks, who went 0-for-4 and extended his worst slide of the season to 2-for-23, said he doesn’t believe Jacoby Ellsbury’s injury finally is impacting the outfield, which collectively has struggled.

Brett Gardner, who was off Saturday, is 3-for-15 on this homestand. Although Judge extended his on-base streak to 26 games and has hit three home runs on the homestand, he is 5-for-20.

“I really don’t think that has anything to do with it,” Hicks said of possible fatigue among the outfielders. “We’re just not hitting well.”

Speaking of the offense overall, Girardi said, “We’re not swinging as well as we did before, so that’s the importance of pitching. Hitting’s going to come and go at times, and that’s where pitching allows you to win games.”

Yankees videos

The Yankees’ pitching did not allow it Saturday, though Luis Cessa wasn’t awful. Making his second start since replacing the injured CC Sabathia in the rotation, he allowed three runs and three hits, including a two-run homer by Carlos Gomez, in five innings. Cessa walked two and struck out eight, six in the first two innings.

The Rangers (37-37) added a run in the seventh against Jonathan Holder on Robinson Chirinos’ homer and four in the ninth against beleaguered reliever Tyler Clippard, who heard the loudest boos he’s heard all week — which is saying something — after allowing three hits and two walks and throwing a wild pitch.

“They were right to boo me,” said Clippard, who has allowed nine runs in 1 1⁄3 innings in his last three appearances and spent several minutes staring straight ahead into his locker after talking to the media. “I’m pitching terrible right now.”

Cessa, who came out throwing in the mid-to-high-90s, put the Yankees in a quick hole when Elvis Andrus singled home a run in the first to make it 1-0.

With one out and one on in the fourth, Cessa got ahead of Gomez 1-and-2 but hung a slider, and his 10th homer gave Texas a 3-0 lead.

advertisement | advertise on newsday

“Tried to throw a slider down and away,” Cessa said. “It was a little up in the zone. A mistake pitch . . . My changeup, my slider, my fastball feels good. I just have to execute all my pitches. One hanging pitch and I paid the price and that changed the game.”