NEW YORK -- Dellin Betances was unable to throw a strike, and with the bases loaded in a tie game, Russell Martin was more than willing to wait it out.
"He's known to do that every once in a while," Martin said. "He's not the kind of guy that gets banged around by contact. He kind of gets himself in trouble with his command, and today you could tell he was fighting with his mechanics or something. He didn't really feel that. When that happens, you got to force him to throw balls in the strike zone."
The Blue Jays showcased plenty of power by tying a season high with four homers as Justin Smoak, Kendrys Morales and Kevin Pillar homered in the first four innings off Michael Pineda. Martin displayed his power by opening the seventh with a game-tying homer off Chad Green.
Ultimately, it was the Blue Jays' willingness not to bite on pitches out of the strike zone that made the difference.
Martin drove in the game-deciding run after Betances (3-4) was unable to end the at-bat after getting to a 2-2 count. After swinging and missing on a curveball, Martin did not swing at the next two curves, and that gave Toronto the lead.
Martin's walk chased Betances from the mound and the All-Star reliever heard boos after issuing four walks for the second time in his career and first time since becoming a late-inning reliever in 2014.
Before walking Martin, Betances also walked Miguel Montero, Pillar and Ryan Goins. Two of those walks were on fastballs, including a pitch clocked at 100 mph to Goins.
"Right now, physically he's off (with his mechanics) and we have to get him back," Yankees manager Joe Girardi said. "We have to get him back on line to where he's throwing consistent strikes because we've seen him do it and when he does it he's dominant."
Betances threw 18 of his 27 pitches out of the strike zone, including 10 in a row at one point. In his last four outings, the 6-foot-8 right-hander has issued 10 walks and allowed seven runs in a span of 2 2/3 innings.
"I feel like I'm too inconsistent with my delivery," Betances said. "My timing is just not there right now. I got to find it. My stuff is there but the timing of my delivery is not there and it's causing me to fall behind guys and walk them."
Betances' latest wild outing sent the Yankees to their 16th loss in 22 games since June 13. It also came on a day when Aaron Judge tied the team rookie record set by Hall of Famer Joe DiMaggio with his 29th homer.
Five innings after matching DiMaggio with his latest homer, Judge was unable to come through again as he struck out swinging at a 2-2 slider against Roberto Osuna as Brett Gardner was the tying run in the ninth inning.
"That's the moment you want to be up, runner on, chance to win the ballgame," Judge said. "It's what you dream of. Just wasn't able to come up and get the job done."
Osuna converted his 21st save and became the fifth pitcher in team history to convert at least 20 straight save chances.
"He's a pretty good hitter," Osuna said. "I'm trying to focus on throwing strikes. He's one of the best, so you got to pitch him really careful."
Said Toronto manager John Gibbons: "Our best against their best and our best won."
Long before the game was decided by the bullpens, the Blue Jays took a 5-0 lead on a two-run homer by Smoak in the third, a solo shot by Morales in the third and a solo homer by Pillar in the fourth off Pineda. Those homers occurred after Toronto's Jose Bautista scored the first run when center fielder Jacoby Ellsbury bobbled Smoak's base hit for an error.
The Yankees stormed back against Marco Estrada, getting two in the fourth on Judge's latest homer. New York made it a one-run game on Ji-Man Choi's two-run homer in the fifth and took a 6-5 lead on a two-run bases-loaded double by Didi Gregorius.
Neither starter got past the fifth inning.
Pineda allowed five runs and nine hits in three-plus innings. Estrada allowed six runs and five hits in 4 2/3 innings.
Three relievers pitched 4 1/3 scoreless innings as Toronto won a series for the first time since June 9-11. Danny Barnes (2-2) struck out three, including Gary Sanchez with two on in the seventh.
NOTES: Yankees OF Dustin Fowler said the rehab for his ruptured patellar tendon will take about four to six months and should be completed in time for spring training next season. ... Toronto C Luke Maile underwent an MRI Tuesday that showed a torn meniscus and surgery is a possibility. ... Toronto manager John Gibbons said RHP Aaron Sanchez (blister) will start Friday after missing over a month on the disabled list for the second time this season. ... 1B Ji-Man Choi became the seventh player to start a game at first base for the Yankees and the 10th player to appear there this season for New York.