Lou Montanez and Adam Jones also hit homers and had two RBI for the Orioles, who have won four of their last six games. Nick Markakis was 3-for-5 with a solo home run and scored twice for Baltimore.
Adam Eaton (2-3) earned the victory while allowing four runs on four hits in five innings.
Johnny Damon and Nick Swisher each hit two-run homers for the Yankees, who lost for the sixth time in seven games.
Phil Hughes (1-2) took the loss after giving up eight runs on eight hits in 1 2/3 innings.