Not only did she rally after twice losing four games in a row against 19th seed Petrova but third seed Sharapova won six of the last eight games in the match after a 73-minute rain delay to take a 6-1, 4-6, 6-4 victory.
"I'm back in the quarter-finals," Sharapova said. "It's a nice feeling. I've got to go from here."
Told that Petrova had dismissed her victory as a creation of the rain delay that disrupted her serve, Sharapova laughed.
"Great," she said. "I'm the winner, so whatever she wants to call it is fine with me."
The Russian third seed, clearly the fan favorite in the Arthur Ashe Stadium night match, was pumping her fist with evry point in the seventh game of the last set when she broke Petrova to seize the lead for the first time since the opening set.
Screaming "Come on" and making her joy abundantly clear even at Petrova errors, Sharapova even launched a fist pump in the direction of Petrova's supporters' box as she reveled in the victory, which was followed by a tepid handshake at the net.
"That energy in the stadium with the music and the cheering, it's just unique," Sharapova said. "It really pumped me up and got me going.
"I wasn't going to leave that court without a fight."
Sharapova, who completed a career Grand Slam by capturing the French Open title last June, rolled through the first set in 31 minutes but Petrova broke her in the second and fourth games of the second set on the way to a 4-0 lead.
Sharapova broke back twice to level the set at 4-4, only to have Petrova break her again in the 10th game to capture the set and in the second game of the third set for a 2-0 lead before rain began falling to halt the match.
"There were so many ups and downs from the beginning of the second to the end of that break," Sharapova said. "I didn't mind the experience of getting off the court and trying again from scratch."
Petrova, who fell to 1-9 all-time against Sharapova, surrendered a break in the first game after the delay and Sharapova broke again four games later then held twice for the victory.
"Overall I'm really happy with the way I came out in the third," Sharapova said. "I didn't let that little letdown bother me and I kept on fighting."
Sharapova will next face French 11th seed Marion Bartoli, who beat Czech fifth seeded left-hander Petra Kvitova, the 2011 Wimbledon winner, 1-6, 6-2, 6-0, to book her first trip to the US Open quarter-finals in her 11th attempt.