Celebrating Matsui's blast off Orioles reliever Jim Johnson, the Yankees reacted with glee to the gesture from the normally reserved Japanese designated hitter. Melky Cabrera snagged Matsui's helmet and Alex Rodriguez tore it from his hands, parading it around the infield.
Later, the Yankees would have a bigger reason to celebrate. New York moved into a tie for first place in the American League East when the Red Sox lost, 6-3, at Texas.
"It's such a tough division," said Andy Pettitte, who hurled 7 1/3 innings of one-run ball and happily took a no-decision. "We're going to have to win. The Rays are good and Boston is good. It almost seems like if you go into a couple-day slump, you really fall back. It's going to happen. The guys keep battling back when we have some adversity."
In the Yankees' ninth walk-off win this season, Matsui posted just his second career home run of that variety, his 15th homer of a season that has been marked by continuing battles with knee injuries but also a clean transition to life as a DH.
"We've always felt that he was real important," Yankees manager Joe Girardi said. "Our biggest concern was his health, and he has been really good. He's had big hit after big hit. He's a guy that knows how to hit in that position."
After the homer -- as has become the popular custom with the Yankees thanks to pitcher and part-time prankster A.J. Burnett -- Matsui was left wiping whipped cream out of his eyes upon being hit from behind with a pie plate.
"The moment I got hit, I realized, 'Man, I had totally forgotten about it,'" Matsui said. "I was watching everybody else and I knew about it, but I was just caught in the moment and I had totally forgotten."
The late fun transpired after Pettitte turned in one of his strongest outings of the year. Nick Markakis took Pettitte deep for a solo home run in the top of the first inning, and Pettitte could have been excused for thinking, "Here we go again."
But Pettitte dusted off his briefly abandoned cutter, as Baltimore managed little else against the veteran left-hander. He left to a warm ovation in the eighth after tying his longest start of the year, posting a season-high eight strikeouts and scattering six hits while walking two.
"I've been feeling so good that it's been awfully frustrating for me," Pettitte said. "I couldn't feel any better about the way stuff has been going, and when the results aren't how you want them to be, it's really frustrating. I'm just hoping I can keep doing what I've been doing."
With Pettitte yielding after 109 pitches to Phil Coke, the left-handed reliever escaped a two-on, one-out jam in unconventional form.
Coke's first pitch was chopped on the ground to first base, where Mark Teixeira alertly fielded it and made an off-balance throw home to Jose Molina to nail Cesar Izturis sliding feet-first for the second out.
Teixeira, a Gold Glove Award-winning defender in his own right, said the play reminded him of his days as a third baseman throwing on the move. He offered his best compliments to Molina.
"For me, the tag is more impressive, because he's got to know exactly where the play is and where the guy is sliding," Teixeira said. "He's blind. It's easy for me to catch the ball and throw it toward him. He made an incredible tag there."
Still not out of trouble, Coke bounced a fastball to Adam Jones that hit Molina in the chest protector and shot toward the Yankees' dugout.
Brian Roberts broke from third base and tried to score the go-ahead run, but the catcher's throw to the plate was in time for Coke to slap an inning-ending tag as Roberts appeared to miss the plate in a key sequence.
"If you don't make those plays, you don't necessarily win the game," Girardi said.
"I got my glove down and there wasn't somebody there to tag, and then I looked up and saw him there going wide," Coke said. "My reaction was to just go get him because I didn't want him touching that plate."
With both Phil Hughes and Mariano Rivera unavailable as the Yankees played their third consecutive 2-1 game, Alfredo Aceves dodged another bullet in the top of the ninth by pitching around a hit batsman and intentional walk, preserving the tie and earning the win on Matsui's heroics.
Making his first career start against the Yankees, David Hernandez held New York to one run -- Eric Hinske's solo home run in the second inning, his fourth homer in four starts since being traded to the Yankees in June -- on three hits over six innings, walking three and striking out four.
The cohesive victory came on a day when Yankees managing general partner Hal Steinbrenner lauded the club's attitude, saying that the mood in the clubhouse is fresher than in years past.
Positive influences aside, the Bombers also seem to be finding ways to win ballgames -- a perfect recipe for strong camaraderie.
"You see the group of guys that we have in there," Girardi said. "Our guys have never stopped playing hard. They seem to really enjoy being around each other; the clubhouse is alive every day. It's a good group and a close group, and I think you can see it in the way we play."