Updated

ARLINGTON, Texas (Reuters) - The New York Yankees overcame a hard-throwing Cliff Lee and five-run deficit to stun the Texas Rangers 7-6 on Wednesday.

Derek Jeter tied the game with a run-scoring single in the ninth inning and Marcus Thames followed with the game-winning RBI as the Yankees completed a comeback that had seen them trail 6-1 at the end of the fifth.

"I know I don't get to play that much, but I take pride in it," Thames told reporters after filling in for absent slugger Mark Teixeira, who missed the game to spend time with his wife and newborn son. "I was excited."

Lee, who had beaten the Yankees twice in last season's World Series when he played for Philadelphia, and with Texas on June 29, struck out 11 batters in 6 1/3 innings.

But the durable left-hander gave up four runs and failed to pitch at least eight innings for the first time in 10 outings.

"I felt good ... I was making pitches early," Lee said. "I started missing a little bit and they're good hitters -- they made me pay for it."

In the bottom of the ninth inning, New York closer Mariano Rivera allowed a lead-off triple to Elvis Andrus but earned the save with three successive outs.

The closer had allowed the game-winning hit to the American League West-leading Rangers (65-48) on Tuesday.

Jeter scored on Lee's wild pitch in the sixth, and New York (70-43) added two runs in the seventh before Thames blasted a solo homer in the eighth to pull his team within one.

To cap the fightback the Yankees got the best of Texas closer Neftali Feliz, who blew his first save since May 11, a stretch of 20 consecutive saves.

New York starter Javier Vazquez allowed six runs in 4 1/3 innings. Texas slugger Josh Hamilton went 3-for-5 with an RBI double while David Murphy had two RBIs after delivering the game-winning hit in the Rangers' extra-inning 4-3 win on Tuesday.

(Reporting by Jahmal Corner; Editing by Peter Rutherford)