The Russian former world number one played at the World Team Tennis "Smash Hits" event in Las Vegas, which raises money for the Elton John Aids Foundation.
Sharapova, who has slipped to 93rd in the world rankings, partnered American Taylor Johnson and lost her first match to Martina Navratilova and Liezel Huber.
"It's very special to be back on the court," she told reporters before the match.
"It's been about seven months since I've played in front of spectators and played in a stadium environment. Obviously, very thankful for the invitation, happy to be part of this cause.
"It's been around for 24 years and it's my first attendance. Thrilled to be part of it."