NEW YORK — Hideki Matsui and Jorge Posada hit back-to-back homers leading off the eighth inning and the New York Yankees beat the Toronto Blue Jays 7-5 on Tuesday night for their eighth win in nine games.

Matsui hit a 3-2 pitch from Jesse Carlson (1-5) deep to right to tie it at 4 and Posada followed with an opposite-field drive that just got over the glove of leaping right fielder Joe Inglett.

The umpires retreated for a video review after a short discussion with Blue Jays manager Cito Gaston, and the call was upheld. Melky Cabrera and Johnny Damon added RBI singles off Josh Roenicke to extend the lead to 7-4.

New York has hit consecutive homers in three straight games for the first time since 1983 and has gone back-to-back 13 times this season.

David Robertson (2-1) retired the only batter he faced to get the win and Mariano Rivera allowed Edwin Encarnacion's first homer with Toronto before finishing for his 33rd save in 34 opportunities.

Encarnacion's one-out drive snapped Rivera's scoreless streak at 22 1-3 innings. Rod Barajas followed with a single before Rivera struck out Inglett and Marco Scutaro to end the game.

Local product Randy Ruiz homered in his return to the Bronx and Lyle Overbay had a three-run double for Toronto, which had won three straight. Scott Richmond allowed three runs — all in the first two innings — and eight hits in his second start since he was sidelined for a month with biceps tendinitis.

Derek Jeter and Damon each had three hits for the Yankees, who improved to 5-1 on their seven-game homestand. Cabrera drove in two runs on his 25th birthday.

Joba Chamberlain allowed four runs and five hits in six innings, and was in line for his first loss since June 18 before New York scored four times in the eighth.

Ruiz, who graduated from nearby James Monroe H.S., hit an 0-1 pitch from Chamberlain off the right-field foul pole in the fourth to give Toronto a 4-3 lead. The opposite-field shot was his second career homer and first since last Aug. 26 for Minnesota at Seattle.

Ruiz, a former Yankees farmhand, appeared in 22 games with the Twins last year — none in New York — in his first big league action after parts of 10 seasons in the minors. Toronto became his 10th major league organization when it signed him in December.

Ruiz, a career .302 hitter in the minors before this year, batted .320 with 25 homers and 106 RBIs in 114 games with Triple-A Las Vegas to earn Tuesday's promotion. He got the call after two-time All-Star outfielder Alex Rios was claimed off waivers by the White Sox on Monday.

The Yankees jumped out to a 3-0 lead against Richmond, who was hit hard in the first two innings. Mark Teixeira's smash skipped past second baseman Aaron Hill for an RBI single in the first and Posada added a run-scoring double. Cabrera hit a sacrifice fly in the second.

New York had a chance for more in each inning but Teixeira was thrown out at home trying to score from first on Posada's two-out drive and Alex Rodriguez flied out to center with the bases loaded to end the second.

Rodriguez was the first of nine in a row retired by Richmond, who struck out eight and walked two.

NOTES: The Blue Jays have homered in six consecutive games and 10 of 11. ... The Yankees held their second Kangaroo Court before the game with Rivera serving as judge, complete with a gavel and robe. "It was great and everything was perfect," a grinning Rivera said, while refusing to get into any specifics. ... New York RF Nick Swisher rested and manager Joe Girardi said Rodriguez, Jeter and Teixeira could get a day off soon. ... There was a moment of silence before the game for Merlyn Mantle, the widow of Yankees great Mickey Mantle, who died Monday at a hospice in Plano, Texas. She was 77.