CHICAGO -- As New York Yankees left-hander Jordan Montgomery warmed up before his start Monday night, he had no idea how his assortment of pitches would carry over to the game.
"You can really never tell," Montgomery said. "Sometimes, when you have your worst bullpens before a game, you have your best games. And you can have a great one, and you go out there and stink it up."
Against the Chicago White Sox, Montgomery did not stink -- even if his stuff was filthy.
The rookie southpaw matched a career high with eight strikeouts, and the Yankees survived a turbulent ninth inning for a 6-5 win.
New York (41-33) snapped a two-game skid and won for only the third time in the past 13 games.
Montgomery (6-4) won his fourth consecutive decision thanks to a dominant slider and a dependable curveball. He limited Chicago to one run on five hits and a walk in seven innings. Of his 100 pitches, 67 were strikes.
"I'm really happy with what he's doing," Yankees manager Joe Girardi said. "He's throwing the ball well. He usually gives us pretty good distance and continues to grow as a pitcher."
The Yankees' bullpen nearly squandered Montgomery's big effort. The White Sox trailed 6-1 entering the ninth but rallied with four runs against left-handers Chasen Shreve and Aroldis Chapman.
Chapman got Todd Frazier to fly out with the tying run on second base to end the game. He earned his eighth save of the season.
Tim Anderson hit a three-run home run for the White Sox to try to spark the late comeback. Anderson finished 2-for-5 in the first game in which he wore corrective lenses at the plate.
"I've been using them in (batting practice), trying to get used to them, and I'm going to continue to use them throughout the rest of the season," Anderson said.
Chase Headley finished 3-for-4 with a double, an RBI and a run to lead the Yankees at the plate. Tyler Austin belted a solo home run and notched two RBIs.
The win did not come without cost for the Yankees. Second baseman Starlin Castro left the game because of a strained right hamstring that he sustained while running out a ground ball.
Castro is scheduled to undergo an MRI exam on Tuesday. Girardi did not rule out a stint on the disabled list.
"He felt it kind of tighten up, so he pulled up (running to first)," Girardi said. "We'll know more tomorrow."
Chicago (32-43) has lost four games in a row and seven of eight.
White Sox left-hander David Holmberg (1-2) allowed six runs (two earned) on five hits in 5 1/3 innings. He walked four and struck out two.
"We fought really hard," Holmberg said. "A couple of smaller innings, and we would have had a 'W.'"
Chicago opened the scoring on a solo shot by Frazier to start the second. The former home run derby champion pulled a low fastball into the left field bleachers for his 13th long ball of the season.
New York scored three runs in the fourth to pull ahead. Aaron Judge drew a leadoff walk and scored on a sacrifice fly by Austin. Headley hit an RBI single, and Jacoby Ellsbury scored on a sacrifice fly by Ronald Torreyes.
Austin homered to increase the Yankees' lead to 4-1 in the sixth. Holmberg left a pitch over the plate, and Austin ripped a line drive over the left field wall for his first home run of the season.
New York added two more runs later in the inning to make it 6-1.
Girardi chuckled when asked about the mood in the dugout during Chicago's late rally.
"In a game of baseball, there aren't too many easy wins," he said.
NOTES: Yankees OF Jacoby Ellsbury was reinstated from the 10-day disabled list after missing a month with a concussion. He batted sixth and went 1-for-5. ... The White Sox recalled RHP Juan Minaya from Triple-A Charlotte and optioned RHP Gregory Infante to Triple-A. ... Yankees OF Aaron Hicks was placed on the 10-day disabled list because of a right oblique strain. New York recalled INF/OF Rob Refsnyder and RHP Ronald Herrera from Triple-A Scranton/Wilkes-Barre. They replaced OF Mason Williams and LHP Tyler Webb, who were optioned to Triple-A. ... White Sox first-round draft pick Jake Burger threw out the ceremonial first pitch. The third baseman hit .328 with 22 home runs in 63 games this season for Missouri State.