Desmond Jennings led off the Rays' fateful ninth knowing he would be facing a legend.
"You know what you're going to get, that cutter, so I just tried to get on base any way I could," Jennings said. "I was just trying to put the ball in play and get on base somehow.
"You still have to go out, regardless of who comes in, and try to do what you have to do to win the ballgame. We were confident that we could still win the game at that point."
Jennings willed a single through the middle. Ben Zobrist followed with a triple to deep right-center field to tie the game.
Evan Longoria and Luke Scott were then intentionally walked in advance of Yankees manager Joe Girardi employing one of Rays skipper Joe Maddon's favorite ploys -- using five infielders.
Eduardo Nunez entered the game to assume a spot near second base, while right fielder Nick Swisher went to the bench, giving the Yankees an extra infielder and leaving Brett Gardner and Curtis Granderson to play a "cover two" set in the outfield.
Rivera helped himself initially by striking out Sean Rodriguez to bring up Carlos Pena.
Earlier in the game, Girardi had elected to have his starter, CC Sabathia, intentionally walk Rodriguez to pitch to Pena. That strategy backfired when Pena hit a grand slam to put the Rays up, 4-0, in the first.
Rivera got ahead of Pena in the count, 1-2. No doubt, many of the home team's fans were wondering at this juncture if 2012 would imitate the '11 season, when Rays runners were so often stranded at third base.
Pena managed to erase that legacy from 2011 for at least a night when he hit a slightly elevated cutter to deep left to drive home Zobrist and give birth to the walk-off win.
"The cutter that [Rivera is] known for, the numbers they speak for themselves -- the guy is unbelievable," Pena said. "I have so much respect for him. And to be able to actually connect there at the end and win the ballgame, it's unbelievable."
Pena returned to the Rays in the offseason, signing a free-agent contract with the team after a year's hiatus with the Cubs. He beamed about his triumphant homecoming, which came on the heels of a dismal Spring Training.
"I felt like I was going to explode, it was just like a kid; I felt like a kid out there," Pena said. "This is why I love this game, when things like this happen. ... You should enjoy it to the max. And I sure did, and my teammates were right there to celebrate with me. This is something I'm never going to forget."
Rivera handled the defeat with grace.
"That's bad," Rivera said. "You don't want to start the season this way. But at the same time, thank God it's only one game. We'll come back tomorrow and play hard again."
Despite holding the 4-0 early lead and having their No. 1 starter, James Shields, on the mound, the Rays could not hold their advantage. The Yankees chipped away with two runs in the second before Raul Ibanez hit a three-run homer to lead a four-run third that gave the Yankees a 6-4 lead.
"I felt I was making some pitches there in the inning when I gave up four runs," Shields said. "You know, obviously, the Ibanez home run wasn't the one I wanted. I thought I was making some pitches. I was getting behind in the count. I threw some quality pitches early in the count. It just wasn't going my way today."
Longoria answered in the bottom of the third with a solo home run off Sabathia to cut the Yankees' lead to 6-5, and 5 1/2 innings of goose eggs followed.
Shields left after five innings, and a parade of relievers followed. J.P. Howell, Wade Davis, Burke Badenhop, Jake McGee, Joel Peralta and Fernando Rodney combined for four scoreless frames to enable the Rays' final comeback.
"We believe we're a good team, and we believe we can play with anybody," Maddon said. "And the Yankees are definitely anybody. I mean, they're really good."
Shields added: "I'll tell you what -- if this is a sign of what's to come, this is going to be an amazing year. Obviously, today we couldn't have asked for anything better. The ending we had, Carlos Pena coming up and coming back. What a homecoming he had today, so it's amazing."