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.

It was A-Rod's 14th slam with the Yankees, snapping a tie with Joe DiMaggio for second place on the team's list.

The long ball was the 654th of Rodriguez's career. He is six homers behind Willie Mays for fourth all-time.

Playing while he appeals a 211-game suspension that stemmed from Major League Baseball's investigation into the now-closed Florida clinic accused of distributing performance-enhancing drugs, Rodriguez has seven home runs in 142 at-bats this season.