NEW YORK -- Alex Rodriguez set a major league record with his 24th career grand slam, passing Lou Gehrig with a tiebreaking shot in the seventh inning that sent the New York Yankees to a 5-1 victory over the San Francisco Giants on Friday night.
Rodriguez's slam helped CC Sabathia (14-13) beat Tim Lincecum in a matchup of former Cy Young Award winners having subpar seasons.
More importantly for the Yankees, it helped them win for the second time in seven games as they cling to faint playoff hopes. New York began the day 3 1/2 games behind Tampa Bay and Texas for the second AL wild card, with three other teams in between.
Alfonso Soriano also homered and New York opened its final homestand of the season with a much-needed victory, hours after pitcher Andy Pettitte announced his plans to retire - again - following this season.
The news about Pettitte hardly came as a surprise, but the 41-year-old lefty put to rest any speculation he might be back next season. Pettitte, who stepped off the mound for a year before returning in 2012, is scheduled to start the series finale Sunday - the same day the Yankees will honor retiring closer Mariano Rivera in a pregame ceremony.
Hometown rookie Juan Perez hit an RBI double for the Giants, who have spent all week in New York. The defending World Series champions took two of three from the Mets at Citi Field, where a large throng of vocal San Francisco fans made them feel right at home.
Giants rooters came out in the Bronx, too, easy to spot in their orange or black jerseys. An audible chant of "Let's go Giants!" quickly drew boos from Yankees fans in the crowd of 41,734.
Plenty were surely there to see Perez, who went to high school in the Bronx and is having a big week in his first trip home as a major leaguer. He went 3 for 3 with an RBI single in Thursday's 2-1 victory over the Mets, then doubled his first two times up Friday - including one off the left-field fence.
Perez said he left 12 tickets for family and friends, but plenty of others bought their own. His father was unable to attend Thursday's game because he was working, but Perez expected him in the stands at Yankee Stadium.