Avisail Garcia led off the ninth with a single and was sacrificed to second. Following an intentional walk to Yolmer Sanchez, Anderson - who was 0 for 3 before the ninth - produced the first walk-off hit of his career.

"We're in last place right now, but we're still grinding this thing out," said White Sox starter James Shields, who allowed three runs and three hits in six innings. "We're still having fun on the field, and the sky's the limit for these guys."

Jorge Polanco homered for the fourth straight game and drove in two runs for the Twins.

Danny Farquhar (3-2) pitched a scoreless ninth for the win. Trevor Hildenberger (2-2) took the loss.

Minnesota starter Ervin Santana allowed two runs (one earned) and three hits in seven strong innings and appeared headed for his 14th win before Chicago rallied.

Santana, who has five complete games, threw just 91 pitches, but was pulled by manager Paul Molitor.

"We could have sent him back out for the eighth," Molitor said. "I just thought that the seventh, that was a good job getting out of that (and) I wanted to turn it over."

The first 17 batters were retired before Alen Hanson hit a hard grounder down the right-field line with two outs in the bottom of the third. Hanson slid in safely with a triple and then raced home as Polanco's relay throw couldn't be handled by third baseman Eduardo Escobar.

Polanco, who was charged with a throwing error for allowing Hanson to score, atoned in the fourth with a solo homer to tie the score. Polanco has seven homers this season.

Polanco gave Minnesota a 2-1 lead in the sixth with a single to drive in Brian Dozier from third base. One out later, Joe Mauer scored from third on a wild pitch to make it 3-1.

Chicago got a run back in the sixth on a solo homer by Leury Garcia and then tied it in the eighth off reliever Taylor Rogers.

ARM ANGLE

Shields has allowed no more than three earned runs in his last four starts. One of the reasons for his recent success is dropping his arm angle down to about three-quarters.

"I've always been kind of a three-quarter guy," he said. "A few years back, I went over the top a little bit more. All it is, I'm going back down three-quarter a little bit more."

ROSTER MOVES

The Twins promoted RHP John Curtiss from Triple-A Rochester before the game. Curtiss, 24, had a 1.28 ERA and 19 saves with 68 strikeouts in 49 1/3 innings between Triple-A and Double-A this season. "John's had a nice year," Molitor said. "The numbers kind of jump out at you."

To make room on both the active roster and 40-man roster, the Twins designated RHP Tim Melville for assignment, meaning that Dillon Gee will assume the fifth starter role for now.

TRAINER'S ROOM

Twins: C Jason Castro left after the fifth inning with concussion-like symptoms. ... RHP Hector Santiago (upper back pain) threw a successful bullpen session on Wednesday and is scheduled to throw another on Saturday. If that goes well, he could make a rehab start on Tuesday.

UP NEXT

Minnesota RHP Jose Berrios (11-5, 3.99 ERA) faces LHP Derek Holland (6-13, 6.28) in the finale of the five-game series Thursday night. Berrios has 10 quality starts in 18 starts this season. Holland is 0-2 with a 27.00 ERA (14 earned runs in 4 2/3 innings) in his last two starts.