The victory also gives Philadelphia (58-67) sole possession of third place in the National League East for the first time since April 12, when the club was a modest 3-3.
Once trailing 3-0, the Phillies climbed back to within one in the sixth and then tied the game in the bottom of the eighth. They provided themselves with good chances to win the game in both the ninth and 10th innings, but didn't capitalize until the 11th.
Kevin Frandsen led off the 11th inning with a single off right-hander Alfredo Simon and advanced to third on a double by Utley. Ryan Howard was intentionally walked to bring up Domonic Brown, who grounded into a forceout at home. But Mayberry came through, dribbling a 97-mph fastball through the hole to score Utley.
"It's hard to keep playing Houdini all the time," Reds manager Dusty Baker said. "They didn't quit. They kept fighting and battling."
The real hero of the game, however, was the Phillies' bullpen. After starter Cole Hamels gave up a two-run double to Todd Frazier in the sixth, the Reds did not manage another hit the rest of the night.
Five Philadelphia relievers, including three rookies, 34-year-old Raul Valdes (3-2) and closer Jonathan Papelbon, combined to shut out Cincinnati for five innings, allowing just two baserunners via walks.
The Phillies appeared poised for another ninth-inning walk-off. Juan Pierre led off with a four-pitch walk and advanced to second on a sacrifice bunt from Frandsen, who managed to reach first safely by dodging Miguel Cairo's attempted tag.
Howard then hit an infield single to load the bases with one out. That brought up Brown, who grounded into an inning-ending double play.
In the 10th, Erik Kratz hit a one-out single and Jimmy Rollins followed with a double to put two runners in scoring position with one out. Brian Schneider, the last position player on the bench, grounded out and Pierre popped up to the infield to end another threat.
But each time the Phillies failed the score, a different reliever blanked the Reds, holding on just long enough for the offense to come through.
"I think it just means that the more we go out there the more comfortable we get, the better we feel," rookie right-hander B.J. Rosenberg said. "All of us, I think, have the stuff to compete up here. It's just a matter of mentally being able to slow the game down a little bit. I think that just comes with getting out there more and getting comfortable."
"We went out there and battled and shut those guys down," said right-hander Phillippe Aumont, who made his Major League debut with a scoreless eighth inning. "I think we did a pretty good job of that. I don't think there's anything more to say. I think we did a great job."
Throughout much of this season, there has been no denying that the bullpen has struggled. Though it has been better since the All-Star break, Phillies relievers have been tagged with 21 losses this season, fourth-most in the Major Leagues. They have also combined for a 4.47 ERA, which ranks fifth-worst in all of baseball.
But the experience some of the younger relievers are receiving is invaluable. Going forward, Thursday's performance was a positive sign for the bullpen.
"We know that when we get in a game, all eyes are on us," said rookie left-hander Jeremy Horst, who threw a scoreless 10th frame and fanned two batters. "That hasn't been a real strong point for us this year, so [we know] that we've got to come in and do the job. It just takes one or two good outings and you get a little bit of confidence underneath you, you start attacking the hitters.
"I think people are starting to see B.J. start to do that a little bit more and Phillippe's is going to come with more and more times out there. We've all had that mentality to come out and do well. People can talk about experience or we might not be the most talented. But if you can come in and get outs it doesn't matter."