The former world number one prevailed 7-5, 6-3 and will make her first quarter-finals appearance since Stuttgart in April, where she lost to Kristina Mladenovic in the next round.
Sharapova, who was beaten by Simona Halep in the third round of the China Open last week, took a 4-3 lead in the first set before Linette hit back. But Sharapova broke her rival in the 12th game to take a 1-0 lead.
'You can still be jealous!' - Dimitrov fires back at weird Sharapova question
Ranked 15 places below world number 71 Linette because of her absence from the tour, the 30-year-old Russian appeared in control in the next set despite conceding an early break.
The five-times grand slam champion broke back twice and held on to set up a clash with Swiss qualifier Stefanie Vogele who beat Yulia Putintseva 6-2 6-3.
Meanwhile, defending champion Peng Shuai beat compatriot Wang Xiyu 6-2 6-2 while Sara Errani got past Brazilian Beatriz Haddad Maia 6-4 4-6 6-3.
Watch Dimitrov respond to weird question about ex Sharapova
Serena? Navratilova? Sharapova? Vote for the greatest women's champion ever