Down to their last out and trailing 3-1 in the ninth, the Phillies rallied against Rockies closer Huston Street. Carlos Ruiz hit a two-out double and Mayberry pinch-hit for reliever Michael Stutes.
Mayberry worked the count full before putting Street's 83 mph slider into the bleachers in left for his seventh homer.
It was Mayberry's first pinch-homer of the year and the third of his career. It was the third pinch-homer by the Phillies this season.
Rex Brothers (1-2) came on to pitch the 10th and Victorino greeted him with a drive clearing the wall in left for the Phillies' 29th come-from-behind victory this season.
Philadelphia improved to 6-6 in extra-inning games while the Rockies lost for the sixth time in seven extra-inning games this season.
Antonio Bastardo (5-0) pitched a scoreless ninth for the victory and Ryan Madson got last three outs for his 19th save in 20 chances.
Phillies starter Cole Hamels allowed two runs and six hits in six innings. He walked one and struck out five while Colorado's Jhoulys Chacin, who had been in line for his first win in six weeks, gave up one run and six hits in 7 1-3 innings. He struck out two and walked two.
Colorado broke on top on Seth Smith's ninth homer of the season. With Ty Wigginton at second after a single and a stolen base, Smith drove Hamels' 2-1 offering into the stand of evergreen trees beyond the fence in center field.
Chris Iannetta added a solo shot leading off the seventh, greeting Stutes with a drive reaching the bleachers in left-center for his 11th home run of the season.
Philadelphia got on the board in the seventh on Raul Ibanez's run-scoring double after missing earlier opportunities.
Victorino tried to score from first on Chase Utley's two-out double off the right field wall in the third but he was cut down on a close play at the plate when catcher Iannetta's sweeping tag snagged his upper jersey before the sliding Victorino could touch the bag.
The Phillies had runners at first and second with one out in the second but Chacin induced Ruiz to ground into an inning-ending double play. Chacin worked out of a jam in the fifth when he struck out Hamels and Jimmy Rollins after giving up a one-out double to Ruiz.
Notes: Smith's homer was his 42nd extra-base hit of the season, second on the club to Tulowitizki's 49. ... Rockies OF Carlos Gonzalez took a round of batting practice before the game for the first time since going on the 15-day DL July 22 with a right wrist strain. ... The Phillies opened a 10-game road trip that will conclude their stretch of 20 consecutive games without a day off. ... The Phillies' Ryan Howard went 0 for 5, snapping his five-game hitting streak at Coors Field during which he batted .476 (10 for 21) with a homer and six RBIs. ... Hamels has allowed two earned runs or less in 12 of his last 13 starts.