NEW YORK -- The Yankees used an eighth-inning rally to beat the Rays, 4-1, in the first game of Monday's day-night doubleheader with 47,436 watching at Yankee Stadium.

It was the Rays' fifth consecutive loss and sixth in their past seven games. On the bright side, they remained seven games behind in the American League Wild Card race to the Red Sox, who were 5-1 losers to the White Sox on Monday afternoon. But clearly, time is running out as the Rays have just 25 remaining games heading into the nightcap.

Nick Swisher drew a leadoff walk off Lance Cormier to start the Yankees' winning rally in the eighth. Mark Teixeira followed with a single to right field that allowed Swisher to advance to third. Teixeira reached second on the play when right-fielder Gabe Kapler threw wildly to third.

After Alex Rodriguez was intentionally walked, Robinson Cano lined out to center field to score pinch-runner Jerry Hairston Jr., who tagged at third to put the Yankees ahead.

"I threw [Cano] a cutter," Cormier said. "I tried to start it off the plate, hoping he'd be aggressive and swing and we'd get a ground ball. He got too much of it and he was able to get it to the outfield.

"I didn't do my job when I went in there. I felt good out there physically. No fatigue or anything. I just didn't execute my pitches. I felt like my pitches were there and good coming out. I just didn't make the pitches when I needed to."

Seemingly in a bad funk, the Rays' bullpen is now 2-9 since Aug. 6.

"I don't think we look at it as a domino effect," Cormier said. "I think guys are just going out there, and we're running into some bad timing right now."

Chad Bradford took over from Cormier and Jorge Posada greeted him with a single to right that scored Teixeira. Eric Hinske's sacrifice fly then scored Rodriguez to put the Yankees up 4-1.

Prior to the eighth inning, the game had been a pitching duel between CC Sabathia and Matt Garza. Sabathia allowed one run on three hits while striking out 10, and Garza allowed one run on five hits while striking out seven. Both pitchers left the game after the seventh.

"I threw well, hit my spots, and pitched to contact," Garza said. "Didn't walk but one and kept them off the bases. I was trying to minimize the damage."

Maddon and Yankees manager Joe Girardi complimented the starting pitching.

"I thought [Garza] was really good ... great even," Maddon said. "He had an outstanding breaking ball today, and there was no extra drama to him out there. He was in total control of his emotions and matched Sabathia all the way through."

Added Girardi: "Both of [the starters] were outstanding -- 1-1 going into the eighth inning. Both of them did their job. CC matched Garza and he was great, and it was just a great pitching duel."

But in the end, the Rays suffered another tough loss.

"It's tough to lose any game, no matter how you pitch," Garza said. "Right now we're trying to win, and we just keep having our backs against the wall. But what do you do?"