– The New York Yankees' dugout exploded, gray-clad players tumbling out of it as if a walk-off homer had won something far more important than a regular-season game.

But the Yankees, beaten up over the weekend by the AL East-leading Blue Jays, could be excused for their enthusiasm.

After nearly getting no-hit, finding themselves one out from defeat and facing the prospect of falling four games behind idle Toronto, Alex Rodriguez and Slade Heathcott — yes, Slade Heathcott — saved the day.

Rodriguez lined a two-out RBI double to right-center off closer Brad Boxberger to tie the score and two batters later, Heathcott's three-run, opposite-field homer sent the Yankees to a 4-1 victory over the Tampa Bay Rays in front of an announced 11,940 at Tropicana Field.

The Yankees (79-64) moved within three games of the Blue Jays with 19 to play.

Held hitless by Erasmo Ramirez for seven innings, the Yankees fell behind 1-0 in the bottom of the eighth on Logan Forsythe's two-out RBI double.

Boxberger, who has 34 saves, came on for the ninth. Pinch hitter Dustin Ackley singled for the Yankees' second hit before Jacoby Ellsbury extended his slump to 0-for-21 by grounding into a 3-6 double play.

But Brett Gardner walked on four pitches, stole second and scored the tying run when Rodriguez ripped a 1-1 pitch into the gap in right-center for his 82nd RBI.

After Brian McCann was intentionally walked, Heathcott — the Yankees' 2009 first-round pick whose career has mostly been defined by injuries and who actually was released last offseason — batted for the first time in a major league game since May 27. The lefthanded-hitting Heathcott wasted no time, swinging at the first pitch and launching a 90-mph fastball just over the wall in left to set off the dugout celebration.

Andrew Miller struck out the side in the bottom of the ninth for his 33rd save.

Ramirez, who came in 10-5 with a 3.90 ERA but had a 4.64 ERA in his previous nine starts, took a no-hitter into the eighth before Carlos Beltran broke it up, leading off with a ground smash off first baseman Richie Shaffer.

CC Sabathia, making his second start since coming off the disabled list, was the best he's been all season, allowing three hits — two of them infield hits — and two walks in 6⅔ shutout innings.