TORONTO -- Aaron Hill had the winning hit, but Toronto's bullpen deserved plenty of credit.
The Blue Jays' bullpen had consecutive tough nights in losses to Tampa Bay on Tuesday and Wednesday, allowing nine runs in four innings, but bounced back against the Yankees.
"They've had two bad games that everybody is talking about but they've had a great year," Hill said. "Today was one of the bigger wins of the year."
"Our bullpen was unbelievable," Vernon Wells said. "That's the key to the victory, those guys being able to come out and put up zeros for that period of time."
Hill followed with a single to center, scoring Encarnacion without a throw.
"[Gaudin] walked the first guy, and that's what really hurt," Yankees manager Joe Girardi said. "Then he got ahead, he got where he wanted to and he just left a slider up to Hill."
A downcast Gaudin struggled for words to express his disappointment.
"I let the team down, I let myself, the fans, everyone," Gaudin said. "It's tough."
The Blue Jays have won six of eight, while the Yankees are 13-14 since May 9.
"It's one of those games where you wish you'd been able to score a run about two hours ago," Derek Jeter said.
The Yankees used a single and two walks to load the bases in the second, but ninth hitter Kevin Russo ended the threat by grounding out to short.
Wells put the Blue Jays in front with a leadoff homer to right in the bottom half, his 14th of the season, extending his hitting streak to 13 games.
Jeter put New York on top with a two-run home run to right in the fifth, his sixth. The homer gave him 1,101 career RBI, moving him past Don Mattingly into ninth place on the Yankees' all time list.
Jeter had a chance to add to the lead in the seventh. Batting with men at second and third and one out, he lined out to Hill at second base, who doubled Francisco Cervelli off third to end the inning.
"You'd like to direct it somewhere else, but unfortunately you can't do that," Jeter said.
Girardi called it the biggest missed chance of the game.
"He does everything he's supposed to do," Girardi said of Jeter. "He's supposed to hit the ball through the middle and hit it hard. We just caught a bad break. We did have a lot of opportunities besides that."
The play proved costly when Gonzalez led off the bottom half with his 12th homer of the season, tying it 2-2.
Yankees starter Andy Pettitte allowed two runs and five hits in 7 2/3 innings. He walked three and struck out a season-high 10.
Blue Jays left-hander Ricky Romero allowed two runs and five hits in eight innings. He walked four and struck out seven.
"[Jeter] was the only offense we had today," Teixeira said. "If it wasn't for him, Romero probably would have pitched nine and shut us out."
New York right fielder Nick Swisher made the defensive play of the game, leaping against the wall to catch a drive by Lewis in the third. Swisher also crashed into the wall as he caught Lind's deep drive in the 10th.
- Yankees OF Marcus Thames was scratched from the lineup because of a stiff neck and replaced by Russo.
- Janssen won for the first time since April 11 at Baltimore.
- Toronto OF Travis Snider, out since May 15 with a sore right wrist, was scheduled to hit off the tee in Florida on Saturday.
- The Blue Jays signed OF Dewayne Wise to a minor-league contract and sent him to extended spring training.