Down 6-2 with two outs and none on in the ninth, the Yankees rallied. Jason Frasor was pulled after a pair of walks and closer Kevin Gregg gave up an RBI single to Eduardo Nunez and hit Derek Jeter with a pitch that loaded the bases.
Gregg retired Granderson on a routine fly just short of the warning track in center field for his 29th save in 33 chances.
Toronto took two of three in the series. The Yankees remained even with Tampa Bay for the AL East lead.
Wells drove in four runs. He tripled to right in the first, homered to left in the third and had an infield single in the fourth.
Hill came in 0 for 20 and was dropped from sixth to eighth in the order, but walked twice before homering to left in the fifth.
Toronto leads the majors with 192 homers this season, including an ML-high 34 in August.
Brett Cecil (11-6) allowed two runs and seven hits in eight innings, matching his career high. He walked two and struck out five.
Cecil is 7-1 with a 2.14 ERA in nine starts against AL East opponents this season, including 2-0 with a 1.64 ERA in three starts facing the Yankees.
The Yankees had won the previous six starts that Phil Hughes (15-6) had made against Toronto, but never led in this one. Wells put the Blue Jays in front with an RBI triple in the first and scored on a passed ball.
After Jose Bautista drew a one-out walk in the third, Wells hit his 23rd home run.
Wells chased Hughes in the fourth with a bases-loaded infield hit. Second baseman Robinson Cano's flip to Jeter was high, allowing Bautista to slide in safely as Hill scored from third. Manager Joe Girardi came out to argue, then pointed to the bullpen.
Javier Vazquez, bumped from the rotation Tuesday in place of rookie right-hander Ivan Nova, came on and ended the inning by getting Adam Lind to fly out.
Hughes, who came in 6-2 with a 2.81 ERA in nine road starts, gave up five runs and six hits in 3 2/3 innings, the most runs he's allowed away from home this year. He walked five, matching a season-high, and struck out six.
Marcus Thames hit a two-run drive to left in the fourth, his sixth home run and second in as many games.
New York first baseman Mark Teixeira, who had four hits in Tuesday's 11-5 win, went 0-for-4 with a strikeout and grounded into two double plays.
Yankees OF Nick Swisher was scratched from the lineup with a sore left knee. He fouled a pitch off his knee in the seventh inning Tuesday. Granderson moved up to bat second while Brett Gardner started in left field and hit eighth, with Austin Kearns moving from left to right. … New York DH Nick Johnson will require a second surgery on his injured right wrist, Girardi said. Johnson has not played since May 7. … The Blue Jays have gone deep 107 times in home games, the most in baseball. … Toronto LHP Ricky Romero, who was away from the team the past two days because of strep throat, rejoined the team and will start Thursday against Detroit.