NEW YORK (AP) CC Sabathia's cutter was back, and the big left-hander returned to the win column for just the second time since the All-Star break.

Didi Gregorius and Aaron Hicks hit two-run homers to help the New York Yankees build a six-run lead and take another step toward their second straight AL wild card with a 10-8 victory over the Baltimore Orioles on Friday night.

Aaron Judge drove in a run for the first time since he returned from the disabled list on Sept. 14, and New York overcame a series of bullpen stumbles to lower its magic number to two over Tampa Bay for ensuring a wild-card game on Oct. 3. The Yankees likely will play Oakland and lead the Athletics by 1 1/2 games for home-field advantage.

''I think we're whole again,'' Sabathia said in a reference to the return of Judge and closer Aroldis Chapman.

Backed by a 6-0 lead, Sabathia (8-7) allowed two runs in six innings and improved to 20-11 against Baltimore. He had been 1-4 in his prior 11 starts this season.

''I thought he commanded his slider and his change and his cutter just a little bit better,'' manager Aaron Boone said. ''He was generating that weak contact that we're used to seeing from him.''

Sabathia struck out five and raised his total to 2,981 . The 38-year-old wasn't sure earlier this season whether he would return in 2019 for a 19th season but has made up his mind.

''I'm going to play next year,'' he said.

Luke Voit added a two-run single to give him 24 RBIs in 31 games with the Yankees, and Hicks scored four runs. After the Orioles closed to 9-8 in the eighth, Judge doubled in a run.

Baltimore dropped to a major league-worst 44-109, overtaking the 1937 St. Louis Browns for second-most losses in franchise history behind the 111 of the 1939 Browns. The Orioles are 60 1/2 games out of first place.

''A lot of young players did some good things, but it's just the pitching is not quite - I don't know if you want to say mature enough,'' manager Buck Showalter said.

Gregorius hit his 27th homer in the first and Hicks added his 25th in a four-run fourth off rookie Yefry Ramirez (1-7), who is 0-4 in 10 starts since beating Boston on July 24. Pitching with cut on his right thumb, Ramirez gave up six runs, six hits and three walks in 3 2/3 innings and fell to 0-3 against New York.

Baltimore closed to 6-4 on Adam Jones' two-run single in the fifth, Austin Wynn's homer against Jonathan Loaisiga and Jonathan Villar's RBI single against former Oriole Zach Britton later in the seventh.

Voit singled off Cody Carroll in a three-run bottom half that put New York ahead 9-4, but Renato Nunez had a two-run homer against A.J. Cole in the eighth and DJ Stewart hit a two-run homer on David Robertson's first pitch as Baltimore closed within a run. Dellin Betances pitched the ninth for his fourth save .

''We're playing as good as we can,'' Sabathia said. ''The more we play together as a whole unit, I think we'll just start to get better and better.''

Asked whether he'd want a couple work weeks before the playoffs, Sabathia smiled.

''No. The season's way too long,'' he said, including a profanity for emphasis.

LOOKING AHEAD

New York hasn't said whether Luis Severino, Masahiro Tanaka or J.A. Happ would start the wild-card game.

Severino got just one out in last year's wild-card game against Minnesota, and New York overcame a three-run deficit to win 8-4. An All-Star for the second straight year, he was 14-2 at the All-Star break but lost six of his next nine decisions before beating Boston this week.

''Sevy got out of the gate extremely hot and like our team has struggled for an extended period of time here in the second half,'' general manager Brian Cashman said, ''but I feel like he's getting back on line, just like I feel we might be getting back on line, too. And if we can do that at the perfect timing, then we are capable of a lot and we will be a more formidable opponent than we've been the last two months and more representative of what we were earlier in the year.''

BOOM!-TOWN

Hicks became the fifth Yankee with 25 or more homers, joining Giancarlo Stanton (35), Gregorius, Judge (26) and Miguel Andujar (25).

Gleyber Torres has 23, and New York could match the mark of six set by the 2003 Boston Red Sox.

LONG NIGHT

Baltimore's Chris Davis struck out four times for the fifth time this year and is batting .170.

STONEWALL SCHOLARS

New York announced a Yankees-Stonewall Scholars Initiative in which five $10,000 scholarships will be awarded to public school seniors - one from each borough - to commemorate next June's 50th anniversary of the Stonewall riots. The scholarships will go to students who demonstrate academic achievement along with commitment to equality and support for the LGBTQ community. The Yankees had been the only MLB team not to launch an LGBTQ initiative. Team president Randy Levine said this initially was a one-time commitment but could be extended.

TRAINER'S ROOM

Orioles: RHP Alex Cobb, who has not pitched since Sept. 11 because of a blister on his pitching hand, is scheduled to start Sunday's series finale. ... RHP Luis Ortiz won't pitch again this year. He made his debut in relief Sept. 7 and left his first start seven days later because of an injured left hamstring. ... LHP Josh Rogers was sent home after three late-season appearances with the Orioles. Rogers pitched 150 1/3 innings this year and reached his limit, according to Showalter.

UP NEXT

RHP Lance Lynn (2-2, 4.47) starts Saturday for the Yankees and RHP David Hess (3-10, 5.22) for the Orioles.

---

More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports

Copyright 2018 by AP. Any commercial use or distribution without the express written consent of AP is strictly prohibited.