BALTIMORE (AP) Those late-July trades are paying off in a big way for the New York Yankees.

Luke Voit connected in the 10th inning for his second home run of the game, and Zach Britton marked his return to Camden Yards by working the bottom half to preserve the Yankees' 7-5 victory over the Baltimore Orioles on Friday night.

The Yankees made up two-run deficits in the fourth and eighth innings before Neil Walker homered off rookie Cody Carroll (0-2) in the 10th to give New York its first lead. Voit added a two-run shot, capping his first career multihomer game.

"It's almost September," he said. "This is crunch time, and this is a big win for us."

Voit drove in four runs in with his first two homers since being obtained in a July 28 swap with St. Louis.

"We acquired him because we think he can hit," manager Aaron Boone said. "Obviously, he broke out in a big way tonight."

Britton spent his entire career in Baltimore before being traded by rebuilding Orioles on July 24. Working as the closer for the injured Aroldis Chapman, the left-hander gave up a home run to longtime teammate Chris Davis before securing his first save with New York.

"It was nice to get into a save situation," Britton said, "but definitely weird to pitch against the guys who I've been playing with for so long."

The Yankees got Britton to pitch in the seventh or eighth innings, but he is certainly capable of working later in the game if necessary.

"We've seen a few good outings in a row from him," Boone said.

Chad Green (7-2) pitched the ninth to help New York win for the 12th time in 17 games.

The Yankees will seek to stay hot in a split doubleheader Saturday. J.A. Happ - 4-0 with New York since coming from Toronto - will pitch the opener.

After Jonathan Villar hit a two-run homer to put Baltimore ahead 4-2 in the seventh, New York immediately answered in the eighth against three Baltimore relievers, loading the bases before Gleyber Torres delivered a two-run single.

Wearing neon-orange jerseys and hats for Players Weekend, the Orioles looked like a completely different team than the one that compiled the worst record in the majors. Until the 10th inning, anyway.

Baltimore struck for two early runs against CC Sabathia, made several sharp plays on defense and got a strong pitching performance from starter Alex Cobb, who brought a 4-15 record to the mound.

Cobb allowed two runs and three hits over six innings, striking out six and walking three. It was his fifth straight start allowing two runs or fewer.

Sabathia allowed singles to the first two batters he faced, and both scored on a single by Davis. Over his final five innings, the big left-hander gave up just two singles and a walk.

After he left, the Yankees got two on and two outs in the seventh before Davis made a diving stop of a grounder hit by Brett Gardner down the first base line. He flipped the ball to pitcher Mike Wright to get the out.

Davis, who began the day batting .163, had a season-high three hits.

CATCH OF THE DAY

Villar made a fine catch in short right field to rob Ronald Torreyes of a fifth-inning single. Villar retreated quickly from his second base position before sliding to the ground and sticking up his glove. The ball popped out, but Villar cradled it with his legs before it hit the ground.

TRAINER'S ROOM

Yankees: Chapman (left knee tendinitis) received an injection Friday and will be "re-evaluated in a couple weeks," Boone said, adding, "We're optimistic that he'll return in an impactful way this season at some point." ... Slugger Aaron Judge (wrist fracture) is "making progress" but has not started swinging yet, Boone said. ... C Gary Sanchez (groin strain) will DH in the Gulf Coast League on Saturday and join Triple-A Scranton next week to begin a rehab assignment. He's been out for a month.

Orioles: DH Mark Trumbo, who's on the DL with right knee inflammation, is exploring the possibility of surgery.