Bronx, NY (SportsNetwork.com) - Brian McCann's two-run homer helped stake the Yankees to a big early lead, and New York held on for a 5-4 decision over the slumping Baltimore Orioles on Friday.

The Yankees built a 5-0 advantage after three innings on the strength of McCann's blast and a two-run double from Carlos Beltran, then later received 2 1/3 scoreless frames from their standout bullpen duo of Dellin Betances and Andrew Miller to record their second straight one-run win in this four-game series.

Brett Gardner went 2-for-4 with two runs scored in New York's 13th victory in its last 17 games. Betances (4-0) was credited with the win after retiring all four batters he faced, as starter Adam Warren failed to last the required five innings.

"The last two innings that he was out there, he got into some long counts and some long innings," said Yankees manager Joe Girardi. "That's why I made the change."

Baltimore was dealt a fourth consecutive defeat after Miguel Gonzalez (3-2) was tagged for five runs in a season-low four innings of work.

"We had plenty of opportunities, we just couldn't get that one blow," said O's manager Buck Showalter.

Jimmy Paredes had a two-run single for the Orioles, while Manny Machado finished 3-for-4 with an RBI in the loss.

Betances was summoned with the tying run at first in the seventh inning and fanned Travis Snider on a nine-pitch battle to keep New York's 5-4 lead intact. The hard-throwing righty set down the side in order in the eighth, and the ex-Oriole Miller did the same in the ninth to notch his 13th save in as many chances.

Miller and Betances have now combined for 32 1/3 innings without allowing an earned run this season.

Warren gave up two and seven hits prior to being yanked with two outs in the fifth. He was handed a quick 3-0 lead as Gonzalez ran into immediate trouble in the bottom of the first, which Jacoby Ellsbury began with a single and Gardner doubled him to third.

Gonzalez got Mark Teixeira to line out after Alex Rodriguez drove in Ellsbury with a sacrifice fly, but his belt-high pitch to McCann on a 3-0 count was deposited into the right-field seats.

The Orioles recorded four hits over the opening two innings but didn't score either time, with Gardner helping keep them off the board by throwing out Machado at the plate on Delmon Young's single in the first.

Gonzalez got into another jam by walking Ellsbury and yielding a single to Gardner to start the third. Despite again rebounding to retire Rodriguez and Teixeira, Beltran followed an intentional walk to McCann by drilling a one- hopper off the wall that increased the margin to 5-0.

Baltimore was able to capitalize on Warren's back-to-back walks that began the fifth. Machado singled in a run and Adam Jones loaded the bases with a base hit before Young plated Ryan Flaherty with a fielder's choice grounder.

Justin Wilson relieved Warren and struck out Chris Davis to strand two and preserve the 5-2 advantage, though the Orioles inched closer in the sixth.

J.J. Hardy ignited a two-out rally with a double off Wilson, who then hit Flaherty and Chris Martin walked Machado prior to surrendering Paredes' sharp single up the middle that trimmed the Yankees' lead to a run.

Game Notes

Ellsbury extended his hitting streak to 11 games, during which he's batted .489 (22-for-48) and scored 10 runs ... Gonzalez struck out a career-high 10 batters over seven innings in a win over the Yankees in Baltimore on April 14 ... T.J. McFarland, recalled from Triple-A Norfolk when the Orioles placed pitcher Kevin Gausman on the 15-day disabled list before the game, tossed three scoreless innings in relief of Gonzalez ... The Orioles fell to 1-11 this season when giving up the game's initial run ... The Yankees ran an Ohio State night promotion in which Buckeyes football coach Urban Meyer threw out the first pitch.