The Yankees, by outslugging the Orioles, regained a one-game lead over Baltimore at the top of the American League East. New York has won two of three in the four-game series.
Baltimore hit six home runs in its win over the Yankees Thursday and all but one of the runs in Friday's contest came on long balls.
New York jumped in front with a five-run fourth that included a three-run homer from Martin and a two-run blast from Pearce. Rodriguez had a two-run shot in the fifth.
Derek Jeter singled in New York's final run in the ninth and Manny Machado hit another solo homer for the Orioles in the bottom of the inning.
All three New York homers came off Wei-Yin Chen (12-9), who lasted only 4 2/3 innings in taking the loss.
Phil Hughes (14-12) survived six innings to grab the victory, giving up two runs on six hits with five strikeouts and no walks.
Susan Sarandon 'very excited' about daughter's pregnancy
Senate Democrats to pull all-nighter on climate change