NEW YORK -- For a moment, Nick Swisher pretended he didn't know what was coming, even though he could practically hear A.J. Burnett charging up from the clubhouse with that well-earned fistful of whipped cream.
Swisher is no stranger to how the Yankees celebrate walk-off wins, but that doesn't make them any less fun. Thursday was Swisher's night to wear the sugary white mask, lifting a sacrifice fly in the 10th inning that secured New York's 6-5 victory over the Orioles at Yankee Stadium.
"That pie was great. It doesn't get any better than that pie," Swisher said. "It just seemed like the sun came out today."
For sure, there were bright spots that the Yankees could savor. Trailing all night and down to their final three outs, Jorge Posada connected for a game-tying homer leading off the ninth against Baltimore's Kevin Gregg, depositing his fifth blast of the young season into the right-field bullpen.
"I feel good at the plate," said Posada, who has just two non-homer hits. "I think it's just a matter of getting on a little streak here, getting good pitches to hit, and understanding what they're trying to do. Hopefully it gets me going."
Mariano Rivera held the Orioles in the 10th to set up his first win of the season, sealed after Mark Teixeira worked a full-count walk to open the home half against Mike Gonzalez and Alex Rodriguez ripped a double down the left field line.
A Robinson Cano lineout set up Swisher, who stepped into the box just looking for something to put in the air. Gonzalez accommodated with a breaking ball, and Teixeira slid home with the throw up the third-base line as Swisher got his sixth career walk-off -- his fourth in pinstripes.
In hindsight, though, the Yankees seemed to agree that the play of the game happened in the eighth. Joba Chamberlain entered a two-on, one-out situation after three innings of relief by Bartolo Colon, promptly uncorking a wild pitch to the backstop.
Pinch-runner Felix Pie bolted from third base, but the ball ricocheted perfectly so catcher Russell Martin could fire to Chamberlain covering home. Chamberlain's leg blocked Pie, who never touched home plate and was correctly called out by umpire Dana DeMuth.
"That was just Joba getting in the way," Martin said. "Joba is going to win that every time. It was a lucky play, we got away with a break."
Chamberlain said he had instinctively blocked Pie's path to the plate. Orioles manager Buck Showalter briefly came out to argue, but it was mostly for show. Even Pie later admitted he was out.
"It all happened kind of fast," Chamberlain said. "To be able to come up big in that situation was awesome."
The wild finish completed a comeback after the Yankees were down, 5-0, in the fifth inning, having been left to claw back after receiving another underwhelming start from right-hander Phil Hughes.
An 18-game winner and American League All-Star last season, Hughes walked off the mound at Yankee Stadium to boos from some in a crowd of 40,517. Manager Joe Girardi had a quick hook, yanking the right-hander after just 70 pitches with one out in the fifth.
With a fastball that averaged 89 mph and touched 92 mph, still several mysterious clicks below where it sat last year, Hughes made it through the first two innings scorelessly before Baltimore was able to connect.
"I thought he was a little bit better the first two innings; we actually saw some 91s and 92s today," Girardi said. "He's still not right."
Markakis turned on an 86-mph cutter and blasted it to right field for a two-run homer, his second of the season. Mark Reynolds added a sacrifice fly in the fourth, a play that could have been more damaging had Curtis Granderson not skillfully propped a foot on the outfield wall to reel in the drive.
Swisher also helped save damage for Hughes by tracking down a Brian Roberts fly ball near the right-field wall in the fifth inning, but Markakis struck again with an RBI double to right that knocked Hughes out of the game.
"It's frustrating," Hughes said. "I feel like I'm bringing nothing to the team right now, and that's a bad feeling, going out there and fighting as hard as I can to try to make pitches and keep us in the game. It's just not going the way I want to right now."
Facing Colon, Vladimir Guerrero knocked in the final run charged to Hughes on a single to left field. Hughes was charged with five runs on seven hits, walking none and striking out two, but Colon helped keep the game close.
"We thought he could do a good job in that role because he's a guy that throws so many strikes and gives your club a chance to come back," Girardi said of Colon.
"You have a Cy Young winner pitching long relief for you," Showalter said. "That's kind of some of the things that you have to applaud them for. He's worked his way back. With the American League lineups, you never feel like you have enough. It's a grind. We were real close."
Baltimore starter Jake Arrieta faced the minimum into the fifth inning, when A-Rod notched the first Yankees hit and then scored on a Cano double.
Teixeira picked up an RBI double, and Rodriguez lifted a sacrifice fly off Arrieta in the sixth to draw the Yankees closer. Arrieta ended up allowing three runs on five hits in six innings.
New York whittled its deficit to a run in the seventh off Jason Berken, as Martin's RBI groundout knocked in Swisher following Granderson's deep double to right-center that narrowly missed clearing the wall.
"Arrieta threw the ball pretty well," Girardi said. "Our guys just kept chipping away, and then you get the big homer from Jorge in the ninth. Our guys have the ability to do that. This is a good offense."
Bryan Hoch is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.