Todd Frazier drove in all three runs for the NL Central-leading Reds, who were seeking their first series win in Philadelphia since 2006.
The Phillies tied it in the eighth on Jimmy Rollins' sacrifice fly and won it on Mayberry's hit to split the four-game set. They took over sole possession of third place in the NL East for the first time since April.
Kevin Frandsen led off the 11th with a single against Alfredo Simon (2-2) and Chase Utley followed with a double. After Ryan Howard was intentionally walked, Domonic Brown hit a bouncer to first and Frandsen was forced out at home.
Mayberry then grounded a single to left.
Raul Valdes (3-2) worked a scoreless 11th for the win. Philadelphia's bullpen pitched five hitless innings.
In a matchup between NL Cy Young Award candidates, neither Johnny Cueto nor Cole Hamels was sharp. Cueto was trying to become the first 17-game winner in the majors. The dreadlocked righty allowed two runs and five hits in five-plus innings.
Hamels gave up three runs and six hits in six innings. He remained unbeaten against the Reds. The lefty entered 8-0 with a 1.26 ERA in 10 previous starts, including a five-hitter to finish off a sweep in the 2010 NL division series.
J.J. Hoover pitched out of trouble in the ninth and 10th. Hoover retired Brown on a double-play grounder with the bases loaded to send the game to extra innings.
After Rollins hit a double to put runners on second and third with one out in the 10th, Hoover got Brian Schneider on a grounder to third and Juan Pierre on a popup to third.
Down 3-2, the Phillies rallied in the eighth against relievers Sean Marshall and Sam LeCure. Brown, Mayberry and Erik Kratz hit consecutive one-out singles to load the bases. Rollins then hit a shallow fly to left. Brown scored ahead of Ryan Ludwick's off-target throw to tie it at 3.
Despite bright skies, it rained hard in the first inning. The Reds loaded the bases with one out on two singles and a walk. Frazier drove in a run on a groundout to third for a 1-0 lead. Phillies shortstop Michael Martinez then saved a run with a spectacular, diving grab on Miguel Cairo's grounder in the hole and made a strong throw to get the out and end the inning.
Hamels seemed a bit perturbed by the downpour and asked the grounds crew to work on the mound during the inning. He also appeared upset that Frandsen didn't throw home on Frazier's bouncer, throwing his hands up in the air.
The defense let Hamels down again in the sixth.
After a leadoff single by Jay Bruce, Ludwick ripped a wicked one-hopper to Martinez, who couldn't handle the ball. It was ruled a hit, though it could've been a double-play grounder. Frazier followed with a double off the base of the wall in center and the ball bounced back through Laynce Nix's legs. Two runs scored for a 3-0 lead and Frazier advanced to third on Nix's error.
Rain stopped by the second, but the field was a little spongy for a few more innings.
Phillies right-hander Phillippe Aumont, acquired from Seattle in the original Cliff Lee trade in December 2009, pitched a scoreless eighth in his major league debut.
NOTES: Cueto leads the NL with 12 hit batters. ... Reds C Devin Mesoraco was reinstated from the suspended list and sent to Triple-A Louisville. ... Frazier has an eight-game hitting streak. ... The Phillies optioned RHP Michael Schwimer to the minors to make room for LHP Jeremy Horst, who returned from paternity leave. ... The Phillies extended their deal with Class-A Lakewood of the South Atlantic League through 2014. ... The Phillies open a three-game series with the division-leading Washington Nationals on Friday night. Kyle Kendrick (6-9) pitches the opener. ... The Reds return home to open a three-game set against St. Louis. Mat Latos (10-3) starts Friday.