BALTIMORE -- Nate McLouth hit a tiebreaking home run in the seventh inning and Kevin Gausman pitched 4 1/3 innings of scoreless relief as the Baltimore Orioles rallied for a 4-3 win over the New York Yankees on Friday night.
Manny Machado added a two-run double for Baltimore, which was held hitless for five innings by Yankeed starter C.C. Sabathia.
The Orioles remain in second place in the American League East, two games ahead of New York.
Robinson Cano had three hits for the Yankees and Brett Gardner added a double and a single.
With two outs in the seventh, McLouth (2 for 3) hit a 1-0 slider from Sabathia (8-6) high over the scoreboard in right field.
Gausman (1-3), who was considered along with T.J. McFarland for Friday's start, took over for McFarland in the third and pitched through the seventh, allowing three hits and striking out four.
Tommy Hunter pitched the final two innings for his second save.
Hitless through five innings and trailing 3-0, the Orioles tied it in the sixth with the benefit of two hits that didn't go 90 feet.
McLouth got Baltimore's first hit, a line drive single to center leading off the inning. Alexi Castilla followed with an infield single between the mound and first. After Nick Markakis popped out, Machado lashed a double to right center, scoring McLouth and Castilla.
Machado raced to third on a J.J. Hardy fly to center and scored the tying run when Adam Jones hit a dribbler halfway up the first base line and beat it out for a single.
Sabathia (8-6) went seven innings and gave up four runs and five hits. He struck out six and didn't walk a batter. The left-hander was making his 400th career start and seeking his 200th win.
He retired the first eight Orioles before Alex Casilla reached on an error by third baseman Alberto Gonzalez.
McFarland, a 24-year-old reliever making his first major league start, lasted just 2 2/3 innings, giving up three earned runs and seven hits.
New York got the leadoff man on in each of first three innings against McFarland and cashed in twice.
Gardner hit McFarland's second pitch of the game to left center for a double and, one out later, Robinson Cano singled him home.
The Yankees opened the third with three consecutive singles, the last one by Vernon Wells that scored Jayson Nix to make it 2-0. Ichiro Suzuki struck out and Zoilo Almonte grounded into a fielder's choice, but Chris Stewart lined a single to center, scoring Cano and ending McFarland's night.
NOTES: A Yankees spokesman explained that a miscommunication between pitching coach Larry Rothschild and the PR staff resulted in the team incorrectly listing David Phelps as the starter for Friday's game. ... INF Brian Roberts, out with a hamstring injury since early April, will rejoin Orioles on Saturday and could play Sunday.