The 2012 champion and last year's runner-up, who will meet Eugenie Bouchard of Canada in the last four, lost the first four games as she conceded the first set before regaining her composure against a player who knocked holder Serena Williams out in the second round.
An early break in the second set was all the seventh-seeded Russian needed to gain momentum.
The match turned Sharapova's way when she held for 3-1 in the third set after saving five break points in a game that lasted over 10 minutes.
"That was one of the most important games in the third set after that game I gained more confidence. That was the turning point," she told reporters.
Once a self-proclaimed 'cow on ice' on clay, Sharapova will be playing her fourth consecutive Roland Garros semi-final, a feat she also achieved at the Australian Open from 2005-08.
Under threatening skies on court Philippe Chatrier, she trailed 4-0 and when she threatened a comeback in the set, Muguruza relied on her big first serve to keep the Russian at bay.
The Spaniard broke to love to take the opening set, but Sharapova is not one to give up without a fight.
Two double faults and a forehand that sailed long gave her a break for 2-1 in the second as Muguruza's game lost in accuracy.
"When you're being a bit more aggressive on the second serves, taking a bit more chances, all of a sudden, she's not hitting so freely," Sharapova said.
"I think that changes a little bit. But it's a combination of the way you feel and also that little pressure that she begins to feel."
A double fault allowed the Venezuela-born Muguruza to break back for 3-3, but in the 11th game the world number 35 sent a backhand wide which gave Sharapova a decisive break.
After breaking early in the decider, Sharapova, who also came from a set down in her last-16 match against Sam Stosur, saved five break points in the fourth game, which featured six deuces.
The four-times grand slam champion took it with a service winner and never looked back.
Muguruza agreed it was probably the turning-point.
"It was really tough to lose this game because it was really hard," she said.
"It's tough now because I had the opportunity to win the match. But I need more experience in these kind of matches."
Follow the French Open on up to 7 courts LIVE on Eurosport player
- Sports & Recreation
- Serena Williams