The Yankees' Ben Rice celebrates in the dugout after hitting a...

The Yankees' Ben Rice celebrates in the dugout after hitting a solo home run against the Toronto Blue Jays in the ninth inning of a game in Toronto on Tuesday. Credit: AP/Jon Blacker

TORONTO — The Yankees needed in the worst way what Ben Rice gave them in the ninth inning Tuesday night.

Staring a five-game deficit in the AL East in the face after coughing up a three-run lead, Rice hit a tiebreaking home run off Blue Jays ace closer Jeff Hoffman with one out in the top of the ninth inning to lift the Yankees to a white-knuckler of a 5-4 victory in front of a sellout crowd of 42,326 at Rogers Centre.

“Huge,” Rice said. “Obviously, we lost five in a row to these guys, so coming back and getting a win here gives us some good momentum heading into tomorrow.”

The Yankees (56-45) closed within three games of the East-leading Blue Jays (59-42), who saw their 11-game home winning streak come to an end.

The Yankees snapped a nine-game road losing streak vs AL East opponents. They’re now 11-17 against the East this season, including 3-6 vs. Toronto,

“We got the monkey off our back a little bit there,” said Devin Williams, who allowed a leadoff single in the ninth to Vlad Guerrero Jr. but struck out Bo Bichette, saw Cody Bellinger make a running catch in the gap on a liner by Addison Barger and struck out Alejandro Kirk to earn his 15th save in 16 chances. “It was nice to have a lead and lock it down.”

Of the drive by Barger, 12-for-24 against the Yankees to that point of the season, Williams thought “it was going to be a double in the gap” before Bellinger, who went 3-for-4 with a homer and two doubles, chased it down.

“He’s a great fielder,” Williams said. “I love watching it. As a pitcher, I’m happy he’s out there behind me.”

Hoffman, 24-for-28 in save chances this season, came on with the score tied 4-4, retired Giancarlo Stanton on a pop-up to start the ninth before Rice hammered a first-pitch, 97-mph fastball to right-center for his 15th homer.

“I think it helped a little bit,” Rice said of facing Hoffman the night before when he struck out looking at a 97-mph fastball to end Monday’s 4-1 loss. “Just kind of knew what the fastball looked like, so obviously that helped. I’m always ready to go first pitch no matter what. Just depends what I’m looking for and in that situation, I was looking for something up in the zone to drive and I was able to get it.”

The wild game included another error by under-fire shortstop Anthony Volpe, who batted ninth for the first time this season and committed his team-high 13th error in the sixth as Toronto scored two unearned runs to tie it at 4-4.

Cam Schlittler, the 24-year-old rookie righthander who won his big-league debut July 9 against the Mariners, matched up against 40-year-old Max Scherzer and outpitched the future Hall of Famer.

Schlittler allowed two runs, seven hits and three walks over five innings, limiting the Blue Jays, known this year for putting the ball in play and driving up pitch counts, to 2-for-7 with runners in scoring position with seven stranded over his five innings.

He was given an early cushion when Jazz Chisholm Jr. cracked his 18th homer, a three-run shot in the first off Scherzer.

“They don’t miss much, they don’t strike out, they definitely put the ball in play,” said Schlittler, who struck out three after striking out seven over 5 1⁄3 innings against free-swinging Seattle in his debut but who never seemed fazed by Tuesday night’s hostile atmosphere and far deeper opposition lineup. “Obviously, the first one was a little bit smoother than the first one. Today was more of a grind.”

Scherzer allowed four runs, five hits and a walk over five innings, striking out four. Bellinger, who came in 1-for-16 with 10 strikeouts in his career against Scherzer, went 3-for-3 against him on this night, including his 18th homer, a shot in the fifth that made it 4-1. Bellinger also made a sliding catch on a sinking liner in the second for the second out, keeping Toronto from loading the bases (the Blue Jays did after a two-out walk but Schlittler got Guerrero to pop out).

“Wow, what a good player. Gosh,” Aaron Boone said of Bellinger. “He’s just such a good defender wherever you put him . . . a couple doubles and a homer. Another big night for him.”

For the Yankees, too.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME