Sharapova had not played singles since last August because of a shoulder injury although she made a brief return to competition in the doubles at Indian Wells in March, losing in the first round.
The Russian seemed in control of the game against Garbin, breezing through the first set and going 4-0 up in the second, however she wasted a match point at 5-3 and lost the tiebreak 6-8.
In the third set, Sharapova was 3-1 down but regained her composure and took the match with a five-game winning streak for victory in just over two and a half hours.
"I was nervous closing that second set because I had not played for a long time," Sharapova told a news conference, at which she sat with ice on her shoulder.
Asked about the injury, she said "The shoulder did not bother me at all during the game. Right now it is numb, I have ice on it."
Photograph: Michael Fiala/Reuters