NEW YORK — Watching the Yankees play with more sureness and swagger lately, Alex Cora noted how different a team they had become.
“They’re more agile, more versatile, more athletic,’’ the Boston Red Sox manager told reporters.
And now, they’re ahead of the Sox in the AL wild-card standings.
Boosted by a four-run second inning and Andrew Heaney’s best start in pinstripes, the Yankees held on for a 5-2 win and completed a three-game sweep of the Sox at Yankee Stadium.
As late as July 27, the Yankees were nine games behind the AL East-leading Red Sox, who had won 10 of their first 13 head-to-head meetings this year.
Winners of six straight games and 13 of their last 16, the Yanks (69-52) have a one-game wild-card lead on Boston (69-54).
Threatening also to vault ahead of Oakland for the top wild-card spot, the Yankees moved into sole possession of second place, five games behind the Tampa Bay Rays.
Returning off the COVID-19 list, first baseman Anthony Rizzo’s two-run single contributed to Boston starter Nick Pivetta’s second-inning knockout.
Subbing for the injured Gleyber Torres, Bronx-born shortstop Andrew Velazquez collected RBI singles in the second and seventh innings.
And it was Velazquez who made the spectacular game-ending play on a grounder toward the hole.
Back from the injured list, Aroldis Chapman (elbow inflammation) entered the ninth in a non-save situation but wound up putting the game in peril.
After yielding a solo homer to Hunter Renfroe, cutting the lead to 5-2, Chapman gave up two singles and manager Aaron Boone called on Lucas Luetge to get the final out.
Batting as the tying run, Kevin Plawecki's hot grounder was backhanded by a diving Velazquez, whose close, one-bounce throw to Rizzo survived a lengthy replay review.
And finally, 39,166 fans could let loose with a final roar.
Heaney joins the party
On the remaining scheduled, the Yanks have one more series with the Red Sox, starting Sept. 24 at Boston, and one more series against the Rays — the final three days of the regular season, at the Stadium.
Next week, the Yankees play four games at Oakland, their final regular season meeting against the Athletics.
Before settling in Tuesday, Heaney got off to another rocky beginning, in his fourth start as a Yankee since being acquired by the Los Angeles Angels.
The lefty has now surrendered a first-inning homer in three straight starts.
Shortly after leadoff man Enrique Hernandez flied out to the right-field warning track, Xander Bogaerts lashed an 0-2 fastball the opposite way for a solo homer, giving Boston a fast, 1-0 lead.
It was the ninth homer surrendered by Heaney in his 16 innings as a Yankee, to that point.
From there, Heaney yielded just one more hit through seven innings, his longest start since July 22 at Minnesota.
Luis Gil staking his claim
But with rookie Luis Gil off to a hot start and Domingo German on track to return soon, you wonder if Heaney — who entered with a 5.78 ERA — might have just saved his rotation spot.
Jameson Taillon, Nestor Cortes, Gerrit Cole and Jordan Montgomery are the Yankees starters listed for a four-game series against the disappointing Minnesota Twins, beginning Thursday night at Yankee Stadium.
Gil ran his historic, scoreless innings streak to begin his MLB career to 15 2/3 innings with Tuesday’s no-decision (4 2/3 IP) in a 2-0 win against Boston, the nightcap of a doubleheader.
According to Elias, Gil’s scoreless streak to open his career is the second longest by a Yankee since Slow Joe Doyle’s 18 shutout innings (over two starts) in 1906.
Called up as the "27th man'' for the doubleheader, Gil was returned to the minors Wednesday, but he is a definite weapon for the Yanks as they enter the stretch.