NEW YORK (AP) - After watching the Yankees honor Mariano Rivera and the fans celebrate Andy Pettitte, Ehire Adrianza made a sweet memory for himself.
Adrianza broke up Pettitte's no-hit bid in the sixth inning with his first career homer, helping the San Francisco Giants beat New York 2-1 and give the Yankees' playoff hopes a serious blow.
"Pablo told me it was a no-hitter, he told me to get a hit," Adrianza said of teammate Pablo Sandoval. "It was a special day for me in my life, for Mariano and Pettitte."
The Yankees held a 50-game pregame ceremony and retired the No. 42 of Rivera, who announced during spring training that this will be his final season. Pettitte said Friday he also is leaving, and he started off with five hitless innings in what likely was his final Yankee Stadium start.
The Giants were cooperating with the day's feel-good atmosphere, until Adrianza, in his ninth career at-bat, sent a line drive into the second row of seats in left field with one out in the sixth to tie the game 1-all. Tony Abreu had a go-ahead double off David Robertson in the eighth, one out after Pettitte gave up a double to Sandoval.
"These guys had a chance to see the best," Giants manager Bruce Bochy said. "The kids really handled themselves well. I couldn't be prouder."
Alex Rodriguez led off the bottom of the eighth with a single, and Robinson Cano doubled for his third hit. Alfonso Soriano hit a sharp grounder to third base, and Nick Noonan threw home to nail pinch-runner Zoilo Almonte. Eduardo Nunez then singled to left field, but Bronx-raised Juan Perez threw Cano out trying to score.
Javier Lopez (4-2) relieved Yusmeiro Petit with two on and one out in the seventh and struck out two. Petit gave up six hits.
Sergio Romo pitched a hitless ninth for his 36th save in 41 chances. In a sign of how banged up the Yankees are, they sent 22-year-old rookie J.R. Murphy to the plate, and Romo struck him out to end the game.
"There is no other Mariano Rivera," Romo said "I was joking around inside to myself warming up that I'm going to get a chance to pitch in Yankee Stadium, to compete on the same mound against Mariano Rivera. But Mariano toed the rubber before I did today."
San Francisco split six games in New York, taking two of three against the Mets.
In danger of missing the playoffs for just the second time in 19 years, the Yankees dropped four back of Cleveland for the second AL wild card with six games left. New York hosts wild-card leading Tampa Bay for three games, then closes at Houston.
"We're still alive, but this one really hurt," Yankees manager Joe Girardi said. "It's tough."
On a sun-splashed afternoon and before a sellout crowd of 49,197, the Yankees honored Rivera by bringing back several of the players who helped them win five World Series titles from 1996-09 _ including Jorge Posada, Bernie Williams, David Cone, Paul O'Neill and Tino Martinez.
Pettitte initially retired after the 2010 season, sat out one year and then returned.
Many of the Giants stood at the top step of their dugout and watched festivities, that included Bay-Area band Metallica playing Rivera's entrance song "Enter Sandman." Pitching coach Dave Righetti led a group of coaches that were former Yankees in presenting Rivera with a pen and ink watercolor by local artist Saul Levy and a guitar from Metallica's Kirk Hammett that was autographed by Hall of Famer Willie Mays.
"Great day," Bochy said. "This ceremony is something they'll remember."
For much of the afternoon, Pettitte seemed on track for a vintage performance. The 41-year-old left-hander, a 255-game winner, was backed by Mark Reynolds' third-inning homer and didn't allow a baserunner until Sandoval's two-out walk in the fifth.
When Sandoval doubled to left in the eighth for the Giants' second hit, Pettitte slammed his glove into his thigh in frustration when he saw Girardi bounce out of the dugout.
He left to a sustained ovation, waving his cap to all parts of the stadium, and came out for another wave after a boisterous chant of "An-dy Pett-itte!"
"It was great. It was amazing," Pettitte said. "You obviously start hugging the guys. You know Jete standing there makes it difficult. ... Then of course my head is right there just going, `I just lost this game for us if we are unable to get this guy.'"
While Rivera has saved 72 of Pettitte's wins, the most for any tandem in major league history, Girardi called on the 13-time All-Star after Abreu's double.
Adrianza broke a bat striking out, and Angel Pagan hit a sinking liner to center field that Curtis Granderson snared with a tumbling catch.
NOTES: The Giants went through fielding practice before the game. Bochy said he's determined to have the Giants play out the season at the highest level possible. "It's about pride," he said. ... The Giants finished interleague play 5-15. Girardi said Hiroki Kuroda (11-12) will start Tuesday's series opener against Tampa Bay. ...
(Copyright 2013 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)