In the eventful eighth, Jeter was caught between first and second on a botched hit and run with Bobby Abreu at the plate, but slid headfirst back into the first base bag safely. A postgame ruling declared Mark Teixeira was given an error and Jeter was actually charged with a caught stealing on the play.
Jeter trotted home on Matsui's double to the gap in right-center field for the game-winner. Jason Giambi, who was walked intentionally before Matsui, was thrown out at the plate on the play.
Yankees starter Andy Pettitte gave up two runs and five hits in six efficient innings. He walked three batters and struck out five in a 107-pitch outing that appeared to be good enough for his second victory of the season. It wasn't.
Pettitte's replacement, Luis Vizcaino, entered with a 3-2 lead but could not hold it. He retired Rangers catcher Gerald Laird, the first batter he faced. But the next batter, Jerry Hairston Jr., made him pay, hitting a solo home run to left field to tie the game at 3.
In what has become a familiar scene in Texas, Alex Rodriguez was booed as he strolled to the plate in the second inning. He was eventually hit by a pitch from Rangers starter Mike Wood but laughed last, advancing to third base on a throwing error by second baseman Ian Kinsler and eventually motoring home on a ground ball by Matsui to give the Yankees an early 1-0 lead.
Texas answered in the bottom half of the frame when Kinsler led off the second with a double off Pettitte and scored on a double by Laird to tie the game at 1.
Giambi's home run in the fourth, his fifth of the season, snapped the tie and gave the Yankees a 2-1 lead. Melky Cabrera extended the lead to two runs in the fifth when he led off the inning with a triple and scored on a sacrifice fly to center by Johnny Damon.
The 3-1 lead did not last.
As for Wood, he was charged with five hits and three runs in 6 1/3 innings. Wood was pitching in place of Kevin Millwood, who has been bothered by a sore left hamstring.
Mariano Rivera closed it out for his second save of the season.
Jesse Sanchez is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.