Yankees outfielder Juan Soto tosses his bat after striking out during...

Yankees outfielder Juan Soto tosses his bat after striking out during a game against the Cardinals at Yankee Stadium on Saturday. Credit: Ed Murray

Will Warren again showed flashes of what allowed him to develop into one of the Yankees’ top pitching prospects.

But at the same time, the rookie righthander has experienced the growing pains that just about every young pitcher goes through, and they again proved costly in the Yankees’ 6-5 loss to the Cardinals on Saturday afternoon in front of 41,454 at the Stadium.

Still, Warren’s four-inning outing was overshadowed by the game’s wild final two innings.

The Yankees (79-57) entered the eighth trailing 6-1. But after two-out singles by Aaron Judge, Austin Wells and Jazz Chisholm Jr. loaded the bases, they pulled within 6-2 on an infield single by Anthony Volpe and 6-5 when pinch hitter Giancarlo Stanton drilled a three-run double high off the centerfield wall on Andrew Kittredge’s first pitch.

Stanton, who was batting for Trent Grisham and entered the day 4-for-45 as a pinch hitter, missed tying the score by only a few feet, but pinch runner Ben Rice was stranded at second when Alex Verdugo grounded to second on the first pitch to him.

Oswaldo Cabrera started the ninth by working the count full against St. Louis closer Ryan Helsley but committed a pitch-clock violation — he was not set in the batter’s box at the requisite eight seconds — and was called out. “It’s completely my fault,” Cabrera said multiple times, declining to make excuses.

Aaron Boone briefly discussed the call with plate umpire Ben May but knew, by the letter of the rule, that the call was correct. “We know the rules, we’ve all played with them now for a couple years, so it’s on all of us . . . you have to adapt,” Boone said.

After Gleyber Torres flied out, Juan Soto doubled into the rightfield corner to bring up Judge, who was intentionally walked for an MLB-leading 17th time. Wells, who had hit a pair of two-out, two-run homers on Friday night and already had two hits Saturday, struck out on a perfect pitch — a down-and-in 3-and-2 slider — to end it.

“I felt pretty good in the box,” said Wells, who sent a screaming liner just foul down the rightfield line on a 1-and-0, 100.8-mph fastball. “He made a good pitch there at 3-and-2 with a low-percentage kind of pitch for him. I was looking for a heater, but he made a good pitch.”

Cardinals righthander Kyle Gibson, who came in 7-6 with a 4.54 ERA, made a lot of good pitches over seven innings in which he allowed one run and five hits. Gibson, 2-7 with a 5.94 ERA in his career against the Yankees entering the game, struck out six and did not walk a batter.

“I thought he did a really good job of really, really mixing,” Boone said. “I thought he had a presence on both sides of the plate . . . He was cutting the ball, sinking it, mixed in some four-seam, and both sides of the plate he had command.”

Warren, who was optioned to Triple-A Scranton/Wilkes-Barre after the game, fell to 0-3 with a 9.55 ERA in five starts after allowing four runs, five hits and three walks in four innings.

Wells doubled and scored on Volpe’s line-drive single in the second, but with No. 9 hitter Victor Scott II (who went 0-for-3 to fall to .167) leading off the third, Warren issued his third walk. Masyn Winn followed with a grounder to Torres that had the makings of an easy 4-6-3 double play, but Volpe double-clutched while coming across second base, allowing Winn to reach first. The mishandle proved costly as Alec Burleson and Nolan Arenado stroked back-to-back singles, tying it at 1-1.

Brendan Donovan then sent a misplaced 1-and-1 changeup just over the wall in right for his 11th homer. The 334-foot drive, which came off his bat at only 89.1 mph, made it 4-1.

“I know that the corners are short, so I was really hoping it would stay in and give us a chance to minimize the damage, but it went out,” Warren said. “It’s frustrating. Just have to be better.”

In the sixth, doubles by Lars Nootbar and Ivan Herrera off Mark Leiter Jr. made it 5-1, and Wells’ throwing error allowed the Cardinals to score what proved to be the winning run.

The AL East-leading Yankees remained 1 1⁄2 games ahead of the Orioles, who lost to the Rockies, 7-5.

Notes & quotes: First baseman Anthony Rizzo (right forearm fracture) arrived in New York via train late Saturday morning after playing a rehab game Friday night with Double-A Somerset, and Boone said after the game that he “likely” will be activated before Sunday afternoon’s game. Rice, who has slumped severely after his three-homer game July 6 against Boston, was optioned to Triple-A Scranton/Wilkes-Barre after Saturday’s game . . . Rosters expand from 26 to 28 Sunday, and the organization continued discussions after the game regarding whom to promote, with prospect Jasson Dominguez very much at the center of those talks. Odds are better than even that the 21-year-old will get the call, though it’s far from a lock . . . It was the first victory for the Cardinals in the Bronx since Tim McCarver hit a three-run homer off Pete Mikkelsen in the 10th inning of Game 5 of the 1964 World Series to give St. Louis a 5-2 win. The Cardinals are 1-7 at Yankee Stadium in the regular season.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 5 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME