TORONTO -- The New York Yankees took advantage of a shaky Toronto bullpen and moved closer to locking up a playoff spot by coming back to defeat the Blue Jays 9-6 at Rogers Centre on Sunday.

Toronto (70-89) had a four-run lead after five innings but New York chipped away and pulled even in the seventh. The Yankees added two more runs in the eighth inning and put the game away with two runs in the ninth.

Reliever Boone Logan (7-2) got two outs for the win as New York (92-67) used a 15-hit attack to salvage a split of the four-game series. Rafael Soriano allowed a run in the ninth before getting Adam Lind on a grounder to end it.

Eduardo Nunez knocked in the go-ahead run with a sacrifice fly and Derek Jeter followed with an RBI single as New York's magic number to lock up a post-season berth was trimmed to one. The Yankees remained tied with Baltimore atop the American League East standings after the Orioles beat Boston 6-3.

Canadian Brett Lawrie hit a two-run homer for the Blue Jays, who had 10 hits on the day.

Toronto's Henderson Alvarez was steady throughout his final start of the regular season, allowing seven hits and two earned runs over six innings. He had four strikeouts and didn't walk a batter.

The Yankees started their comeback in the sixth by scratching out a run. Robinson Cano doubled, moved to third on a Nick Swisher single and scored on a wild pitch.

Alvarez struck out Canadian Russell Martin to get out of the jam. Brett Cecil relieved Alvarez in the seventh and was pulled after giving up a single to Nunez.

Reliever Steve Delabar didn't fare much better.

He gave up a ground-rule double to Jeter and Ichiro Suzuki knocked in Nunez with a sacrifice fly. After a walk to Alex Rodriguez, Cano cashed in Jeter with a double to make it a one-run game.

Aaron Loup relieved Delabar and threw a wild pitch that brought home Rodriguez with the tying run. The Blue Jays escaped further damage when Swisher lined out to Yunel Escobar at short, who flipped the ball to Lawrie to double off Cano at third base.

Toronto's bullpen continued its struggles in the eighth as reliever Darren Oliver (3-4) walked Curtis Granderson and gave up a single to Raul Ibanez.

Brandon Lyon came on and Martin, from Chelsea, Que., dropped down a sacrifice bunt to move the runners ahead. Nunez then stroked a fly ball to centre that brought home Granderson.

In the ninth, reliever Jason Frasor loaded the bases and Granderson took advantage with a two-run single.

The Blue Jays started the game strong, getting to Yankees starter Phil Hughes in the opening inning. Rajai Davis singled, moved to second on a walk to Edwin Encarnacion and scored on an Escobar double.

Encarnacion scored the game's second run on a sacrifice fly by Lind.

Eric Chavez put the Yankees on the board in the third when he took the first pitch from Alvarez over the wall for his 16th homer of the season. New York later put runners on the corners after Lawrie threw wildly to first after snagging a hot shot from Cano.

Lawrie, from Langley, B.C., atoned for the error by tracking down Swisher's slow grounder and throwing him out to preserve the one-run lead.

Ichiro made a highlight-reel catch in the bottom half of the frame. Encarnacion hit a ball to the right-field corner but the Japanese star tracked it down on the fly before crashing into the padding underneath the seats.

Lawrie hit his 11th homer of the season to deep left-centre field in Toronto's three-run fifth. Hughes gave up three straight two-out hits before being pulled, including Moises Sierra's RBI single that scored Escobar.

Hughes allowed five earned runs, eight hits, two walks and had four strikeouts.

Announced attendance was 31,418 on fan appreciation day.

Notes: Encarnacion left the game in the seventh. He was pulled as a precaution due to a tight muscle in the left shoulder area. ... The game took three hours 25 minutes to play. ...The Rogers Centre roof was closed. ... The Blue Jays will close out the regular season with a three-game series against the visiting Minnesota Twins. Aaron Laffey (4-6) is the scheduled starter for Monday's opener. The Twins will counter with Esmerling Vasquez (0-2). The Yankees will finish off with a three-game home series against Boston.