CHICAGO (AP) Even with the second-worst record in the majors, the Chicago White Sox know how to stage a comeback.

On Friday night, they had extra inspiration.

Tim Anderson's go-ahead triple drove in two runs as the White Sox scored three times in the sixth inning and went on to defeat the Milwaukee Brewers 8-3.

Chicago rebounded from an early three-run deficit and ended a four-game losing streak after reliever Danny Farquhar threw out the ceremonial first pitch. Farquhar suffered a brain hemorrhage in a game on April 20, underwent surgery and returned to the mound just six weeks after the life-threatening episode caused by a ruptured aneurysm.

''It was awesome and a good win for the team and that we did it after (Farquhar) was out there on the mound with us,'' said White Sox starter Hector Santiago, who allowed three runs through 3 1/3 innings and then was bailed out by 5 2/3 innings of hitless ball from five relievers.

Farquhar was joined by his teammates, family and medical caregivers on the infield as he made the ceremonial toss to reliever Nate Jones.

''It was an emotional day today,'' manager Rick Renteria said. ''Very uplifting. I'm sure there's some residual to it, but at the end of the day these guys have to perform between the lines, and I think they did.''

The White Sox mounted the entire go-ahead rally with two outs as they posted their 12th come-from-behind win. Every player in Chicago's lineup had at least one hit.

After Jose Abreu singled and Daniel Palka walked, Anderson's liner dropped in front Christian Yelich, then got by the Brewers left fielder and rolled to the wall, allowing Abreu and Palka to score. Omar Narvaez followed with an RBI single.

Yolmer Sanchez and Palka added RBI singles as Chicago tacked on two more runs in the seventh against reliever Dan Jennings.

Luis Avilan (2-0), Chicago's second reliever, recorded one out in the sixth to earn the win. Joakim Soria, Bruce Rondon and Jones each followed with a hitless inning.

Anderson is 10 for 26 in his last five games with four homers, 10 RBIs and seven runs scored.

Ryan Braun hit a two-run homer for the Brewers, whose lead over the second-place Cubs in the NL Central dropped to three games.

Brewers starter Chase Anderson (4-4) allowed four runs and five hits through 5 2/3 innings in a second straight rough outing.

Santiago was on the ropes early, giving up five hits and five walks before being replaced by Chris Volstad with one out in the fourth and the game tied at 3.

''Our chances were the first three innings,'' manager Craig Counsell said. ''We had first and second, bases loaded and first and second the first three innings.

''We had chances to get that next hit, just didn't happen.''

Braun homered to right-center in the first to put Milwaukee ahead 2-0.

The Brewers extended their lead to 3-0 in the third on Hernan Perez's sac fly to center.

The White Sox tied it with three runs the bottom of the inning.

Adam Engel led off with a double, then scored on Charlie Tilson's single. Tilson came home when Brewers third baseman Travis Shaw threw wide after fielding Trayce Thompson's grounder. Thompson advanced to second on the error and scored on Moncada's single.

WELCOME BACK

Farquhar made a low-and-away throw as the crowd of 20,004 and the Brewers gave him in a standing ovation.

It was the first time Farquhar threw a baseball since he suffered the ruptured aneurysm, underwent surgery and spent 18 days in the hospital. Farquhar won't pitch again this season, but has been cleared to start throwing.

ROSTER MOVES

Milwaukee recalled INF/OF Ji-Man Choi was recalled from Triple-A Colorado Springs. Choi has had two previous stints this year with the Brewers, hitting .267 with a solo homer in 17 plate appearances. ... Milwaukee outrighted C Jett Bandy to Triple-A after designating him for assignment last week.

TRAINER'S ROOM

Brewers: RH starter Zach Davies was placed on the 10-day disabled list with right rotator cuff inflammation. The move is retroactive to May 30, when Davies allowed five runs over five innings in a 6-1 loss to St. Louis. Davies, who spent three-plus weeks on the DL in May for the same injury, is 2-5 with a 5.23 ERA after going a team-best 17-9 last year. Counsell expects Davies' return to the DL to be short. ... 1B Eric Thames (torn ligament in left thumb) took batting practice at the team's spring training facility in Phoenix on Friday for the first time since undergoing surgery on April 27. He could begin a rehab assignment next week.

UP NEXT

Brewers RHP Jhoulys Chacin (3-1, 3.69) faces White Sox righty James Shields (1-5, 4.54) on Saturday. Chacin allowed five runs in 6 1/3 innings against the Mets last Sunday in a no-decision, but is 3-0 with a 2.90 ERA in his last nine starts. Shields hasn't won through 11 starts since opening day at Kansas City.

---

For more AP baseball coverage: https://apnews.com/tag/MLBbaseball

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