CHICAGO — Not much has come easy for the New York Yankees over the past two weeks. Not even the wins.

Jordan Montgomery matched his season high with seven solid innings and closer Aroldis Chapman shut down a ninth-inning rally just in time, lifting the Yankees over the Chicago White Sox 6-5 on Monday night.

New York led 6-1 entering the ninth, but Yankees reliever Chasen Shreve gave up a three-run homer to Tim Anderson and Chapman allowed an RBI double to Jose Abreu. Chapman retired Avisail Garcia and Todd Frazier to finish his eighth save and first since returning from the disabled list a week ago.

"The way things have been going, we'll take it right now," said Chase Headley, who had three hits and an RBI. "It's not always pretty, but we had to find a way to win."

Recently recalled outfielder Tyler Austin lined a solo homer and had a sacrifice fly for New York, which won for the third time in 13 games to keep pace with Boston atop the AL East.

"It was a big-time win for us," Austin said. "They tried to make a little comeback there in the ninth, but Chappy, as he always does, shut the door."

Yankees second baseman Starlin Castro returned to the starting lineup after getting a shot in his wrist Saturday, but strained his right hamstring running out a grounder in the third. He was replaced by Rob Refsnyder in bottom of the inning.

Manager Joe Girardi said Castro would get an MRI on Tuesday. He wouldn't speculate how long the infielder might be sidelined.

"When I tried to run, I was just feeling something tight," Castro said.

Austin Romine and Ronald Torreyes each drove in runs with sac flies.

Montgomery improved to 4-0 over his last five starts. The 6-foot-6 left-hander allowed five hits, struck out eight and walked one.

"We're really happy with what he's doing," Girardi said. "He usually gives us pretty good distance and continues to grow as pitcher."

Austin played in his third game this season since his recall from Triple-A Scranton/Wilkes-Barre on Saturday.

Frazier hit a solo homer for the only run off Montgomery (6-4). New York took advantage of three Chicago errors to score four unearned runs off starter David Holmberg (1-2).

"Listen, I thought Holmy kept us in the ballgame," manager Rick Renteria said. "And today was not a very clean ballgame."

The Yankees activated outfielder Jacoby Ellsbury from the disabled list and put him in centre field. Out since May 24 with a concussion, he had a single in five at-bats and scored twice.

RESERVING JUDGE-MENT

As of Monday, rookie sensation Aaron Judge led AL players in votes for the All-Star Game, but the 25-year-old outfielder still hasn't decided if he'll accept last week's invitation to the Home Run Derby.

"I've got a job to do on the field, so the last thing on my mind is worrying about the Home Run Derby," said Judge, who leads the majors with 26 homers. "That's kind of on the back-burner."

ROSTER MOVES:

The Yankees recalled Refsnyder and RHP Ronald Herrera from Triple-A. ... The White Sox recalled RHP Juan Minaya from Triple-A Charlotte and optioned RHP Gregory Infante.

TRAINER'S ROOM

Yankees: New York put OF Aaron Hicks on the DL. He injured his ribcage during a check swing Sunday and is expected to miss three to four weeks. ... DH Matt Holliday sat out his second game due to issues stemming from an allergic reaction he had in Oakland on June 17. He was sent for tests. ... Girardi said LHP CC Sabathia "is feeling pretty good" after throwing a 35-pitch bullpen Sunday. Girardi said the team is "still deciding if (Sabathia) does one more bullpen or a simulated game next."

White Sox: LHP Carlos Rodon will make his first start of the season on Wednesday against the Yankees after being sidelined because of bursitis in his left biceps. He threw 4 1/3 innings for Charlotte on Friday. ... Before the game, GM Rick Hahn announced RHP Zach Putnam had Tommy John surgery last week and will miss the remainder of the season. Putnam, who was placed on the 10-day DL on April 25 with right elbow inflammation, had a 1.04 ERA in seven appearances this season.

UP NEXT

New York RHP Luis Severino (5-3, 3.30 ERA) will try to get back on track against Chicago LHP Jose Quintana (4-8, 4.69), who has won his past two starts. The 23-year-old Severino gave up a season-high six runs to the Angels in his last start and lost for the first time since May 1.

___

More AP baseball: https://apnews.com/tag/MLBbaseball