A 5-1 New York victory over Toronto on Saturday put the Yankees in the playoffs and officially eliminated the Blue Jays from postseason contention.
Greg Bird hit a three-run homer and Sonny Gray worked six strong innings as New York guaranteed itself a berth in the wild-card game at a minimum.
"They got the lead and with their bullpen, they're as good as anybody — tough to crack," said Toronto manager John Gibbons.
Blue Jays starter Joe Biagini walked Chase Headley and Starlin Castro in the fifth inning before Bird smacked his sixth homer of the season. Todd Frazier added an insurance run in the eighth with his 27th homer and Castro brought home another run with an infield single in the ninth.
"(Biagini) was effective and then he kind of hit that wall a little bit," Gibbons said. "You could tell because he started losing the strike zone."
Chad Green, David Robertson and Aroldis Chapman worked an inning of relief apiece for the Yankees. New York (86-68) still has a slim chance of catching first-place Boston in the East division race but will most likely host the wild-card game on Oct. 3.
"It's a great accomplishment," said Yankees manager Joe Girardi. "We learned a lot about our young players, our veteran players. To see the kids kind of grow up in front of you, it's special."
The Yankees remained four games behind the Red Sox, who shut out Cincinnati 5-0. New York entered play with a 5 1/2-game lead on the Minnesota Twins, who currently hold the second wild-card spot.
"What a team to be a part of," Bird said. "What a group."
Toronto (72-83) made American League Championship Series appearances in 2015 and 2016 but has spent most of this season in last place.
"A frustrating year for everybody," said Biagini, who allowed three hits and three earned runs over five innings.
Gray (10-11) was in form on a hot, sunny afternoon at Rogers Centre. He gave up a solo homer to Teoscar Hernandez in the third inning and kept the rest of the Toronto bats in check.
The teams will meet in the rubber game of the three-game series Sunday in Toronto's home finale.
The Blue Jays tested Gray early by putting two runners on in the opening inning. Kendrys Morales nearly drove in a run with a sinking liner, but Brett Gardner made a sliding catch to end the frame.
Hernandez, meanwhile, delivered his second no-doubt homer in as many days. He belted a 1-0 pitch into the standing-room section of the 200 level for his fourth home run of the year.
New York threatened in the fourth after Aaron Judge laced a one-out double to the wall. Gary Sanchez walked before Didi Gregorius lined out to Darwin Barney, who quickly threw to Ryan Goins to double off Judge.
Gray battled some control issues in the sixth as he walked Justin Smoak and Morales. Gardner made a nice running catch to prevent a Kevin Pillar drive from finding the gap and Goins grounded out to end the inning.
Gray allowed four hits, one earned run and three walks while striking out four. Biagini issued four walks and struck out three.
New York outhit Toronto 7-4. Announced attendance was 46,949 and the game took two hours 54 minutes to play.
Notes: Toronto right-hander Marcus Stroman (12-8, 3.01 earned-run average) is scheduled to start Sunday against left-hander Jaime Garcia (5-9, 4.19). ... Yankees pitcher Luis Severino was hit in the upper back by a line drive during batting practice. He was not seriously hurt. ... Toronto outfielder Steve Pearce is not expected to play during the team's season-ending road trip next week due to a suspected back injury. ... The Blue Jays will make a visit to Boston before closing out the campaign in New York.