TORONTO - There are far too many games left to call Friday night's a season-saver.

It only felt that way to a great many Yankees fans -- and maybe a few Yankees, too.

Pinch hitter Carlos Beltran's go-ahead three-run homer with one out in the eighth inning gave the Yankees a 4-3 victory over the Blue Jays in front of a stunned sellout crowd of 46,689 at Rogers Centre.

The Yankees (63-51) moved back into first place in the AL East, a half-game ahead of the Blue Jays (64-53), whose winning streak ended at 11 games.

The drama didn't end with Beltran's blast. Andrew Miller, who has been shaky of late, walked pinch hitter Chris Colabello with one out in the ninth and allowed a single by Kevin Pillar. A wild pitch allowed both runners to move up, but Miller struck out Ben Revere and Troy Tulowitzki, after a world-class 12-pitch at-bat, for his 26th save.

Ivan Nova (5-4, 3.57), who pitched the first seven innings, earned the victory. Three of the five hits off him came in a three-run third inning.

The Yankees had led the Blue Jays by eight games on July 28. Since then, entering Friday night, the Jays had gone 14-1 to the Yankees' 5-9.

The Yankees entered the eighth trailing 3-0 against David Price and showing little indication that a comeback was in the offing. Dating to last weekend, they hadn't scored in 33 straight innings against Toronto.

But after Alex Rodriguez flied out to start the eighth, the Yankees followed with four straight hits. Mark Teixeira, in a 7-for-43 skid, and Brian McCann each singled and Chase Headley lined a ground-rule double to make it 3-1. It was his third hit of the night and second double.

Blue Jays manager John Gibbons brought in hard-throwing righthander Aaron Sanchez to face Chris Young and Joe Girardi countered by sending up the switch-hitting Beltran.

He swung through two high fastballs, took another for a ball and then slammed a fourth straight 97-mph pitch to right-center for his 11th homer. The blast gave the Yankees a 4-3 lead and sucked the air right out of the stadium, which seemed poised to celebrate what would have been a franchise-record 12th straight victory.

Dellin Betances struck out Jose Bautista to start the bottom of the eighth and retired Edwin Encarnacion and Justin Smoak -- on a long drive to center that initially appeared to have a chance to clear the fence -- to end the inning.

Price, who came in 11-4 with a 2.35 ERA, including 2-0 with a 0.60 ERA in two starts since the Blue Jays acquired him from the Tigers at the trade deadline, allowed 11 hits and three runs in 71/3 innings.

Nova turned in a more than solid effort against the majors' highest-scoring team (615 runs entering the night). He even managed to keep the Blue Jays, who had homered in 12 straight games, in the ballpark.

The Blue Jays scored all of their runs in the third. Nova hit Pillar in the rib-cage area and Revere, after misfiring on two bunt attempts, stayed with an 0-and-2 curveball and punched a single to left to put runners at the corners. Tulowitzki hit a ground smash back up the middle that deflected off Nova's right hand. Shortstop Didi Gregorius did well to pick up the ball and get the force at second, but Pillar scored to make it 1-0.

After Girardi and trainer Steve Donohue checked on Nova, Donaldson rifled a single to left and, swinging at the first pitch, Bautista ripped an RBI double to left to make it 2-0. Encarnacion's sacrifice fly to center made it 3-0.

The Yankees, who stranded eight through the first seven innings, got two-out singles by Jacoby Ellsbury and Brett Gardner in the fifth, but Rodriguez flied to short right to end the inning.

Headley doubled with two outs in the sixth and Young then smoked one up the middle, but the ball deflected off Price's glove to second baseman Ryan Goins, who threw him out.