The only production the Bombers had had was one solo home run by Nick Swisher in the third inning.
But in the eighth, without much offense, things came apart for the Rays and the Yankees got lucky with their 20th come-from-behind win of the year.
The inning started with lead off Derek Jeter making an out.
But then Johnny Damon sliced a hit into left field.
Rays manager, Joe Maddon, decided to pitch around Mark Teixeira and put him on first base with an all-but-intentional walk.
Alex Rodriguez came to the plate and worked a walk as well, loading the bases for Robinson Cano.
Cano was also walked to force in the Yankees' second run of the game.
Jorge Posada then came to the plate and hit a ball to Willie Aybar, playing third base for the Rays in place of injured Evan Longoria.
Aybar rushed the play trying to get a double play by stepping on third and throwing out the slow Posada at first.
Instead Aybar muffed the play, got no one out and allowed Teixeira to score the tying run.
Hideki Matsui then came to the plate with A-Rod on third representing the go ahead run and Posada on first.
Swisher grounded weakly to the second baseman who was shading up the middle.
Ben Zobrist fielded the ball and tagged Posada who ran right into the tag instead of pulling up and forcing Zobrist to throw to second.
Posada almost cost the Yanks the winning run because of his mental error, but Matsui was hustling down the line and beat Zobrist's throw to first as A-Rod crossed home.
Mariano Rivera came in to close the game in the ninth and pitched very well.
Unlike the night before, manager, Joe Girardi, allowed Rivera to pitch to Evan Longoria who was once again called to pinch hit for catcher, Dioner Navarro.
In Saturday's game in almost the same situation, Girardi forced Mo to walk Longoria and pitch to B.J. Upton who got a hit and drove in a run to pad the Rays lead.
But on Sunday, when Mo was allowed to pitch to the hobbled Longoria, the greatest closer in major league history induced Longoria to ground weakly to Robinson Cano for the last out of the game.
The Yankees got another come from behind win, but they were very lucky in doing so.