Heavy rain sent the players running for cover at 6-6 in the decider, shortly after the Russian had fended off a match point with a winning forehand.
When they finally returned on a damp night in the Italian capital, Sharapova won the first three points of the tiebreak. Although China's Li battled back to 4-4 and 5-5, the second seed grabbed the last two points for victory.
"This is a great win for me going into Roland Garros," Sharapova said.
"I know the level she played there last year and the level she can play on clay, the way she defends and moves around and gets herself back into position, she's just a great player on any surface really. So this gives me a lot of confidence.
"It will be nice to have a week off now, after playing three tournaments in the last four weeks. I'll have to time to recover, mentally and physically."
The rain break merely added to the drama of a match which swung first one way and the other, with Sharapova saving a match point at 5-6 to force the deciding tiebreak.
With defending champion and world number two Sharapova making far too many unforced errors, eighth seed Li had led by a set and 4-0 before losing her way.
In steady drizzle, Russian Sharapova then won eight straight games on her way to leading 4-1 in the final set before letting Li back in.
After a short break at 5-5, 30-30, a determined Li saved a break point to stay ahead.
With both players hitting top form, the Chinese then forced a match point on the Sharapova serve but the Russian saved it with a forehand winner.
As heavy rain began to fall, Sharapova held for 6-6 and with the lines becoming slippery, the umpire took the players off court at 4.40pm local time.
Li is still without a title since winning her first grand slam title at Roland Garros almost a year ago.