Officially, the day revolved around Rivera, the all-time saves leader who's retiring after this season. Unofficially, Pettitte shared the glory, as evidenced by the standing ovation he received upon leaving the game. Ultimately, the game belonged to the Giants, who received airtight pitching and outstanding defense to finish 6-4 on their final trip of the season.
The Giants even had their own Bronx hero -- left fielder Juan Perez, who grew up near the previous version of Yankee Stadium and worked out on the fields adjacent to the ballpark, literally in its shadow. Perez threw out Zoilo Almonte at home plate in the eighth inning to preserve San Francisco's lead, moments after third baseman Nick Noonan also apprehended a runner at home.
A third rookie, shortstop Ehire Adrianza, hit his first Major League home run to end Pettitte's no-hit bid after 5 1/3 innings and tie the score. Thus, this afternoon was a tribute not just to accomplished legends, but also to promising youth.
"I couldn't be prouder of those guys and how they handled themselves," Giants manager Bruce Bochy said of his kiddie corps.
The finish unfolded furiously.
The Giants broke a 1-1 tie in the eighth. After Pablo Sandoval's leadoff double ended Pettitte's afternoon, Tony Abreu lashed a one-out double on a first-pitch curveball from David Robertson to drive in Noonan, who was pinch-running.
Yankees manager Joe Girardi explained why he left in Pettitte (10-11) to face the switch-hitting Sandoval and removed him for Robertson, who entered the game with 75 strikeouts in 63 innings.
"Sandoval, you want to hit right-handed as opposed to left-handed," Girardi said. "Andy's stuff, to me, was still really good. Abreu, I've got a strikeout pitcher on the mound [Robertson] and he has struggled against curveballs more than any pitch that he's struggled against. Under .100. And he ends up hitting a curveball, maybe his second hit on a curveball, and that's why I left [Robertson] in there."
Right-hander Santiago Casilla began the Yankees' eighth by yielding Alex Rodriguez's single. Robinson Cano doubled pinch-runner Almonte to third. But Noonan snared Alfonso Soriano's one-hopper with a dive to his left, then straightened and threw home to retire Almonte.
"Luckily I kind of saw him take off out of the corner of my eye," said Noonan, who was particularly alert after being freshly inserted into the game. "Whenever you get put in like that, the ball always finds you. It always does."
After Casilla struck out Curtis Granderson, Eduardo Nunez singled to left field. Perez charged the ball, gathered it in shallow left and threw on the fly to retire Cano.
Perez already was prepared, having told himself, "'If it comes here, I'm just going to let it go.' The opportunity came and I put everything I had into that throw."
Rivera finished the game for the Yankees, because that was only fitting, with 1 2/3 scoreless innings. But the save went to Giants right-hander Sergio Romo, who pitched a perfect ninth.
As all relievers would, Romo viewed Rivera as the master of their craft.
"To compete on the same mound against Mariano -- he toed the rubber before I did today," Romo said. "It was pretty sweet for me."
Romo wasn't the only Giants reliever to distinguish himself. Left-hander Javier Lopez stranded runners on second and third in the seventh inning by striking out both batters he faced, pinch-hitter Vernon Wells and Ichiro Suzuki.
One inning earlier, Adrianza contributed his home run. Given his total of 17 homers in 2,489 at-bats over eight Minor League seasons, the event was something of a surprise. Adrianza said that he was merely following orders. "Pablo told me, 'He's got a no-hitter. Do something.'"
Said Lopez, "We were looking for some sign of life and I think that kind of sparked everybody a little bit."
Giants starter Yusmeiro Petit sustained his bid for a spot in the team's 2014 rotation by allowing one run and six hits in 6 1/3 innings. San Francisco has won each of his six starts. Mark Reynolds' third-inning leadoff homer for the Yankees represented Petit's only serious lapse.
Afterward, the Giants exuded their respect for Rivera as much as the thrill of victory. Players and coaches crowded the visitors' dugout railing as they eagerly viewed the pregame celebration of his career.
"We're sitting there watching not only the greatest closer in the game, but also a huge part of the history of the game," Bochy said.
The Giants organization honored Rivera by giving him an oil painting of him pitching during a save he recorded at AT&T Park in a June 22, 2007, Interleague game; a customized guitar autographed by Willie Mays and designed by Kirk Hammett of Metallica, whose song, "Enter Sandman," has been Rivera's entry music; and a $4,200 donation to Rivera's foundation.
"The finish wasn't what I was looking for, but it was a great day," Rivera said.
The Giants would fully agree.