Gleyber Torres and Anthony Rizzo also connected off Blue Jays starter Robbie Ray, and Brett Gardner added a solo homer as New York (91-68) slimmed its magic number to clinch a postseason spot to two. The Yankees host AL East-champion Tampa Bay in their final series of the regular season.
"We're just getting started," manager Aaron Boone said. "We've got more to do. It makes the plane ride home a little nicer, but we've got business to attend to tomorrow."
The Yankees are two games ahead of Boston and idle Seattle, both 89-70, after the Red Sox lost to last-place Baltimore 6-2 earlier Thursday. Toronto trails New York by three games.
"We've just got to go one game at a time and win every game now, for sure," Blue Jays manager Charlie Montoyo said. Toronto hosts the Orioles on the final weekend of the season.
New York has won eight of nine but could be in better shape. First baseman Luke Voit went on the injured list Thursday with a sore left knee, and infielder DJ LeMahieu was replaced in the bottom of the sixth inning because of right hip soreness.
LeMahieu also missed last Saturday's game at Boston but was able to return Sunday.
"I think it was affecting him more at the plate tonight," Boone said. "Hopefully like last time, having a little treatment and just managing it as best we can, we'll see if he's back in there tomorrow or not."
Michael King (2-4) pitched 1 1/3 scoreless innings for the win in relief of Corey Kluber. Luis Severino worked a perfect seventh, Chad Green struck out three straight after giving up a leadoff double in the eighth and Aroldis Chapman finished in the ninth.
"It wasn't a postseason game, but it definitely had the atmosphere and the feel," Judge said.
New York's first five hits were home runs. Judge hit a 455-foot solo blast in the first that landed in a disused lounge area below the center field scoreboard. He hit another drive to center, a 441-footer into the batter's eye, as the Yankees homered three times in the sixth to erase a 2-1 deficit.
"Two awesome swings," Boone said of Judge. "He's playing like the great player that he is right now when we need him the most."
Surprisingly, Judge said he wasn't sure he'd got enough when he made contact on his first homer.
"I didn't know if I hit it too high and it wasn't going to go out," he said. "I really didn't enjoy it too much. I'll have to check the replay to see where it went."
For Judge, the home runs were his 37th and 38th. It was his sixth multihomer game of the season and the 16th of his career.
Ray (13-7) walked Giancarlo Stanton after Judge's first-inning blast but escaped further damage when Torres flied out to the warning track in right.
Gary Sánchez walked to begin the second, but Ray responded by retiring 13 consecutive Yankees.
Rizzo ended that streak with a one-out drive to right in the sixth, his 21st. Judge followed with his second homer, Stanton walked and Torres ended Ray's outing with a two-run shot to left, his ninth.
Ray stumbled in the final chance to make his case for an AL Cy Young Award, allowing four hits, all home runs, and matching a season high by giving up five runs in 5 1/3 innings. He walked three and struck out four.
"Their game plan against me was to try to lay off the slider and get a fastball out over," Ray said. "The home runs, I think they were all on fastballs. I've just got to do a better job of being able to land that slider early."
The four home runs allowed matched Ray's career-worst, set April 29, 2016 against Colorado while pitching for Arizona.
"I don't think he had his best slider command today," Rizzo said of Ray.
Gardner made it 6-2 with a homer off Julian Merryweather in the ninth, his 10th.
Toronto's Corey Dickerson answered Judge's first homer with an RBI double off Kluber in the second, and Vladimir Guerrero Jr. chased Kluber with an RBI double in the fifth that bounced off the top of the center field wall.
Kluber allowed two runs and seven hits in 4 2/3 innings. King came on and walked Bo Bichette before getting Teocar Hernández to ground out.
Judge made a diving catch on Santiago Espinal's sinking liner to end the second, stranding a runner at second base. Judge said he banged the left pinky finger that he dislocated in Sunday's win at Boston when he landed.
"That one didn't feel too good," he said.
Marcus Semien's single in the third was the 1,000th hit of his career.
Yankees: Recalled right-hander Albert Abreu from Triple-A Scranton/Wilkes-Barre. ... Boone said tests Wednesday night showed no fracture for OF Joey Gallo, who left Wednesday's game after being hit on the left forearm by a pitch in the seventh. Gallo was held out of the starting lineup but replaced Stanton in LF in the eighth.
Blue Jays: OF Lourdes Gurriel Jr. was held out of the lineup after playing the past two games because of soreness in his right hand. Gurriel needed two stitches to close a cut on the back of his hand after being spiked by teammate Randal Grichuk on a play in the outfield last Thursday.
Blue Jays LHP Steven Matz (13-7, 3.88) starts Friday as the Blue Jays open a three-game home series against Baltimore. The Orioles have not named a starter. Matz is 1-1 with a 6.00 ERA in three starts against Baltimore this season.
Yankees: LHP Nestor Cortes (2-2, 2.85) starts Friday in the opener of a three-game home series against Tampa Bay. RHP Shane McClanahan (10-6, 3.44) is expected to start for the Rays.
(© Copyright 2021 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)
for more features.