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. It was a fitting way to mark the end of a skid in which all six defeats came at home.

"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."