TORONTO -- First place in the AL East nearly slipped away from the New York Yankees.
New York scored seven times in the last three innings to beat the Toronto Blue Jays 9-6 on Sunday to salvage a split of the four-game series. More important, the Yankees maintained their tie with the Baltimore Orioles atop the division standings.
Eduardo Nunez's sacrifice fly to right-center field with one out in the eighth inning brought home Curtis Granderson with the go-ahead run.
"I think it's a big win for us to be able to come back in that situation," Yankees manager Joe Girardi said. "I'm confident in this group. I've seen them do it so many times."
Nunez had earlier pinch-hit for Eric Chavez, who homered in the third off Toronto starter Henderson Alvarez for New York's first run.
Also in the eighth, pinch-runner Brett Gardner came around to score on a Derek Jeter base hit to right.
The Yankees added two runs in the ninth off reliever Jason Frasor.
The Jays loaded the bases in the ninth with no outs against Rafael Soriano, but the Yankees' closer got Yunel Escobar to ground into a double play that scored one run and first baseman Adam Lind to ground out to second.
The Yankees play host to the hated Boston Red Sox in their final series, and despite the Red Sox being well off the pace this season, the Yankees know Boston would love nothing more than to spoil New York's aspirations of another division title.
"They're going to have the mind-set of trying to spoil our season," Yankee catcher Russell Martin said.
Reliever Boone Logan (7-2), who recorded the last two outs in the seventh inning, picked up the win and Darren Oliver took the loss (3-4).
The Blue Jays took a two-run lead in the home half of the first off Yankees pitcher Phil Hughes. With one out, left fielder Rajai Davis singled and Edwin Encarnacion drew a walk. Escobar doubled to right to bring home Davis, and Encarnacion scored on Adam Lind's sacrifice fly to center.
The Yankees got on the board in the third when Chavez took the first pitch he saw from Alvarez out to right for his 16th homer of the season.
"There has been some growth in his understanding of how to work through challenges inside a given inning," Blue Jays manager John Farrell said of Alvarez, who gave up two runs in six innings of work. He'll finish his first full major-league season with nine wins.
"The overall start to finish -- going through a full major-league season -- is a success in its own right. And the overall growth based on the challenges he faced."
Alvarez said: "It was a great year of experience, I have one year now, I feel like I know (things) a little bit better. Hopefully next year when I come back I can apply everything that I learned this year and have a better season."
Toronto tacked on three runs in the home half of the fifth. Brett Lawrie crushed a 1-and-1 pitch from Hughes into the second deck in left center. Anthony Gose also scored as he was on first with a leadoff single.
The inning wasn't over as the Jays continued to hit Hughes. Escobar, Lind and Moises Sierra all singled, with Sierra's scoring Escobar for Toronto's third run of the inning. That brought an end to Hughes' day. He was replaced by Derek Lowe.
Trailing by three in the sixth, the Yankees started to fight back. Nunez led off with a pinch-single and Jeter hit a ground-rule double down the right-field line. Nunez came in on an Ichiro Suzuki sacrifice fly to center, and after Alex Rodriguez walked, Robinson Cano brought in Jeter with a double to right.
Rodriguez scored to tie it on a wild pitch by Blue Jays reliever Aaron Loup, but further damage was avoided when Escobar went to his right to grab Nick Swisher's line drive and then threw out Cano, who was caught off third.
Now the Yankees are ready to take on the Red Sox.
"Nothing would make their season more than to spoil our season," Swisher said. "We've got to go there and take care of business. It's a rivalry series. I get juiced up for games like that. You can throw records out the window in them. We control our destiny. If we win, we go on. If we lose, we're done, and that's exciting."
Notes: The attendance at Rogers Centre on Sunday was 31,418. ... Encarnacion left the game in the seventh inning for precautionary reasons with tightness in his left upper trapezius muscle. ... New York returns home for its final series of the season when it plays host to Boston for three games that starts on Monday. Toronto will play host to the Minnesota Twins to conclude its season.