Chase Utley led off the 10th with a double and David Purcey (0-1) walked Jimmy Rollins. The runners advanced on Domonic Brown's groundout and Darin Ruf was intentionally walked to load the bases.
Ramon Troncoso relieved and struck out Young. But Mayberry lined Troncoso's first pitch up the middle for the winning run.
Antonio Bastardo (3-2) pitched a scoreless 10th to earn the victory.
All three games in the series went extra innings. The teams played a total of 34 innings over 11 hours, 12 minutes.
The White Sox scored a run in the ninth off Jonathan Papelbon, who blew his fifth save in 25 chances.
Brown drove in two runs for the Phillies, who have won nine of their last 13 games. Brown, picked for his first All-Star team, upped his team-leading total to 67 RBIs entering the break.
Cole Hamels was poised for his third straight win after a poor start to the season prior to Papelbon's blown save.
The left-hander has a 1.57 ERA in his last three starts. He allowed two runs and eight hits while striking out seven and walking none in eight innings. The three-time All-Star enters the break with a 4-11 record.
Alejandro De Aza homered for Chicago, which enters the All-Star break having lost seven of its last 10 and 31 of 44.
Brown's two-run double in the first off Jose Quintana gave the Phillies a 2-0 lead. Philadelphia added a run in the fourth on Hamels' RBI single, the first of his two hits.
The White Sox scored in the seventh on Jeff Keppinger's RBI single.
De Aza hit a solo homer in the eighth.
Dayan Viciedo hit a one-out single in the Chicago ninth and pinch-runner Blake Tekotte stole second. After Keppinger flied out, Josh Phegley singled up the middle to tie it at 3.
Papelbon was booed loudly as he walked back to the dugout after the inning ended.
Quintana allowed three runs on five hits in six innings. It was the ninth straight start without a loss for Quintana, who has just one win during that span.