"I haven't been on a court for a while, for both of us, it was to have some fun and a bit of laughs," she added.
Sharapova later paired with US legend John McEnroe in the evening's final game against Navratilova and Andy Roddick.
Sharapova had not played since testing positive for meldonium at the Australian Open.
The 29-year-old, who has suffered from persistent shoulder injuries, admitted in March she had tested positive for meldonium during the Grand Slam, held in January.
A two-year ban was imposed by the International Tennis Federation in June, back-dated to January, and she appealed to the Court of Arbitration for Sport (CAS) seeking a reduction.