The Russian beat the Italian in the Roland Garros title match last year to complete a career Grand Slam and again triumphed this time round.
With a win over the sixth seed, Sharapova reached the semi-finals in the California desert for the sixth time and said she hoped to secure a second title to go with the one she captured back in 2006.
"I'm giving myself an opportunity to be back in the final, and hopefully I will go farther this time," said Sharapova, who was runner-up to Victoria Azarenka last year.
Sharapova was slow out of the blocks against Errani, as she was in her 7-5, 6-0 victory over Spain's Lara Arruabarrena-Vecino.
The Italian broke her in the first game of the match as Sharapova delivered two double faults and although the Russian immediately regained the break she dropped her serve again in the seventh game with another brace of double faults to trail 4-3.
Sharapova buckled down, however, getting the break she needed to force a tiebreak in the 10th game before fending off a set point in the tiebreaker.
She wrapped up the match after two hours and one minute - just after the clock ticked past midnight in California.
In the semi-finals she'll face Russia's Maria Kirilenko, who beat 2011 Wimbledon champion Petra Kvitova 4-6, 6-4, 6-3.
Kirilenko, who beat third-seeded Agnieszka Radwanska in the fourth round, improved to 6-0 in three-set matches this year and reached the Indian Wells semi-finals for the first time in 10 appearances.
The remaining women's quarter-finals were scheduled for Thursday. Top seed Azarenka will face eighth-seeded Caroline Wozniacki of Denmark and fourth seed German Angelique Kerber will take on seventh-seeded Australian Samantha Stosur.
Results on Wednesday from the eighth day of the ATP Masters and WTA BNP Paribas Open (x denotes seeded player):
Men
Fourth round
Jo-Wilfried Tsonga (FRA x8) bt Milos Raonic (CAN x17) 4-6, 7-5, 6-4
Kevin Anderson (RSA) bt Gilles Simon (FRA x13) 6-3, 1-6, 6-4
Tomas Berdych (CZE x6) bt Richard Gasquet (FRA x10) 6-1, 7-5
Roger Federer (SUI x2) bt Stanislas Wawrinka (SUI x18) 6-3, 6-7 (4/7), 7-5
Andy Murray (GBR x3) bt Carlos Berlocq (ARG) 7-6 (7/4), 6-4
Juan Martin del Potro (ARG x7) bt Tommy Haas (GER x19) 6-1, 6-2
Rafael Nadal (ESP x5) bt Ernests Gulbis (LAT) 4-6, 6-4, 7-5
Women
Quarter-finals
Maria Kirilenko (RUS x13) bt Petra Kvitova (CZE x5) 4-6, 6-4, 6-3
Maria Sharapova (RUS x2) bt Sara Errani (ITA x6) 7-6 (8/6), 6-2