BALTIMORE - The shaving cream was still glopped on Chris Dickerson's head and shoulders long after the final pitch, a tell-tale indicator that the Baltimore Orioles had finally returned to celebratory mode at Camden Yards.

Nate McLouth homered leading off the bottom of the 10th inning, Dickerson hit a pair of solo shots and the Orioles beat the New York Yankees 3-2 Tuesday night to snap a six-game losing streak.

McLouth hit a 1-1 pitch from Vidal Nuno (1-1) into the bleachers in right-center to give the Orioles their first win since May 12. Dickerson, who played sparingly for the Yankees in each of the past two seasons, connected off Phil Hughes in the third and fifth innings - the first two-homer game of his career.

For their efforts, McLouth and Dickerson each got a shaving cream pie from teammate Adam Jones during their postgame interviews.

"We really needed this win," Dickerson said. "This team continues to grind, continues to push forward even when the chips are down. Nate came up huge. This was one of those things that can turn it around."

Asked if it was the best night of his baseball career, Dickerson quickly replied, "Absolutely. Under the circumstances, yeah. ... As soon as I saw the lineup card I was already fired up, just to get the opportunity to play against them. But to go out and have that result, it was awesome."

Jim Johnson (2-4), who blew three save opportunities during the six-game skid, got three straight outs in the 10th.

"I'm just happy about the outcome of the game," Johnson said.

Orioles pitchers retired 21 of the last 22 New York batters.

"It was nice to win, period," manager Buck Showalter said. "Anytime, regardless of yesterday and the day before. We don't get bogged down in that woe is me and this means that. You've got to keep turning the page."

Travis Hafner drove in both runs for the Yankees, who fell to 19-1 when scoring first.