Muguruza, who knocked out top seed Serena Williams in the second round, looked on course for another shock win when she stormed into a one-set lead.
Seventh seed Sharapova recovered her composure, though, and hit back to take the next two sets and move into the last four.
Rising star Eugenie Bouchard awaits Sharapova, though the 27-year-old has won each of her two meetings with the Canadian - including a 6-2 6-4 victory at last year's French Open.
The Russian has reached the final in each of the last two years at Roland Garros, winning in 2012 before defeat to Williams last year and is gunning for what would be her fifth grand slam title.
Muguruza got off to a flying start, breaking Sharapova to 15 in the opening game with a whipped cross-court forehand winner.
She delivered another telling blow in game three, the Russian surrendering with a double fault as the Spaniard claimed some breathing space.
A third break was to follow in game seven as Sharapova crumbled, sending a weak forehand into the net as Muguruza wrapped up the opening set in less than 30 minutes.
Sharapova hit back in the second set, Muguruza handing her a break point with consecutive double faults, before sending a forehand long to give the seventh seed the advantage.
That was wiped out shortly after though, Sharapova contributing to her own downfall with two double faults as Muguruza levelled at 3-3.
Sharapova recovered and made the crucial break in game 11, getting the better of her opponent after a long rally, before she sent the match into a decider as Muguruza dumped a forehand into the net.
With her confidence returned, Sharapova took the initiative early in the final set, forcing a break when a deep forehand had too much for Muguruza to return, the Russian moving 2-1 up.
She took the match further away from her opponent in game five, Muguruza once again finding the net as Sharapova closed in on victory.
And she rounded off the triumph as Muguruza's attempted passing shot found the net, moving Sharapova into a fourth consecutive Roland Garros semi-final.