NEW YORK, N.Y. - More than a week after they wobbled back to the Bronx in last place, Chase Headley, Carlos Beltran and their New York teammates whooshed out of Yankee Stadium looking way more potent.

Headley lined a pinch-hit double to break a seventh-inning tie, Beltran launched his 400th career home run and the Yankees wrapped up a successful homestand by beating the Chicago White Sox 7-5 Sunday.

The Yankees overcame a hiccup by reliever Dellin Betances to finish a much-needed 7-3 against the AL Central-leading White Sox, World Series champion Kansas City and eternal rival Boston.

"It really shows we're capable of winning against good teams," Beltran said.

The Yankees also have their vaunted bullpen set up exactly the way they envisioned.

After Betances recovered to escape his own jam, Andrew Miller pitched a perfect eighth and Aroldis Chapman closed for his third save.

"Obviously, it's a big homestand for the whole team," Headley said. "I think we're playing the way we're capable of."

The White Sox have dropped four of five overall, and lost for the 13th time in their last 15 games at Yankee Stadium.

"We're just going to enjoy the off day on Monday, that's realistically what we're looking at right now," said Adam Eaton, who homered and squeezed home a run.

"We had a long trip, Texas and here, and so when we get home to Chicago, I'm sure we're all really going to enjoy family and take a nice relaxing day with family, so we're excited about that," he said.

A day after striking out all four batters he faced, Betances (1-2) was shaky. He took over in the seventh with a 5-4 lead, but Jose Abreu and Todd Frazier greeted him with singles and Melky Cabrera hit a tying double. Betances recovered to retire the next three batters.

Matt Albers (1-2) set down the first two batters in the New York seventh. Didi Gregorius then walked and Headley, batting for Ronald Torreyes, doubled to centre.

Headley was stuck in a season-long slump before going 7 for 20, including his first extra-base hits of the year, in seven games since his 32nd birthday.

Beltran's two-run drive in the sixth put the Yankees ahead 5-4. He became the 54th big leaguer to reach 400 home runs, with Mickey Mantle, Eddie Murray and Chipper Jones the other switch-hitters to do it.

Beltran connected from the right side, immediately after lefty Zach Duke took over for lefty reliever Dan Jennings. Beltran joined Carlos Delgado and Juan Gonzalez as players born in Puerto Rico to hit at least 400 homers.

"Just to be next to them, it motivates me to finish my career strong," Beltran said.

Beltran said he's felt "double responsibility" over the years to properly represent his teams and his homeland. Hitting No. 400 "means a lot to me and my family and Puerto Rico," he said.

Beltran was able to retrieve the milestone ball, too, trading two signed bats for the souvenir.

Injured Yankees slugger Alex Rodriguez was the first player to greet Beltran at the top step of the dugout, giving his teammate a big hug and taking off his batting helmet.

Chicago's first error in May, a wide throw by second baseman Brett Lawrie on a slow roller by Jacoby Ellsbury, set up Beltran's home run. The speedy leadoff man made his first start since May 6 after straining his hip.

Brian McCann homered in the Yankees eighth.

"We're playing a lot better baseball, that's for sure," manager Joe Girardi said. "We're swinging the bats, we're scoring runs, we're winning close games."

Starters Masahiro Tanaka and Miguel Gonzalez both were slow and ineffective. They combined to allow seven runs on 13 hits and eight walks while throwing 193 pitches in 9 2/3 innings.

NICKED

Ellsbury reached on catcher's interference for the fourth time this year, tipping Alex Avila's mitt on a swing. The big league record for a season is eight by Roberto Kelly in 1992.

Ellsbury has done this before — he's caused 18 calls of catcher's interference since 2007, two more than Carl Crawford for most in the majors during that span.

TRAINER'S ROOM

Yankees: LHP CC Sabathia (strained left groin) threw a simulated game and did fielding drills in the morning. He's set to come off the disabled list and start Friday night in Oakland.

UP NEXT

White Sox: Off Monday, Chicago opens a 10-game homestand when LHP Carlos Rodon 1-4, 4.99 ERA) faces reigning AL Cy Young Award winner Dallas Keuchel (2-5, 5.58) and the Astros.

Yankees: After the game, the Yankees switched their rotation for the series at Arizona. RHP Chad Green will now start Monday in his major league debut. RHP Michael Pineda had previously been listed.