Williams then struck three groundstroke errors as well as a doublefault to drop serve and reach five games all.
Serving down 5-6 40-30, Williams hit another down the line forehand winner to hold serve and reach the tiebreaker.
In the tiebreaker, the American struck two down the line backhand winners before hitting a 91 miles per hour ace out wide on set point to take the set.
In set two Kontaveit capitalized on several early errors from Williams to break serve twice to lead 3-0 before also improving her level of play to take set two and level the match at one set all.
Williams struck several aggressive serves, forehands and volleys to break serve and lead 4-1 including an inside out down the line swinging forehand volley winner.
The Estonian then held serve to reach 4-2.
Williams struck several additional powerful shots in her following service game including a down the line backhand winner to end a 19 shot rally and a swinging inside out crosscourt forehand volley winner on game point to lead 5-2.
Serving to stay in the match, Kontaveit double faulted before committing two backhand errors to face triple matchpoint.
Williams struck a down the line backhand winner to break serve and end the match after two hours and 27 minutes of play.
In round three Friday, Williams will face Ajla Tomljanovic of Australia.
Although Williams will be the favorite on Friday, the 46th ranked Tomljanovic reached the quarterfinals of Wimbledon the last two years in her best grand slam results.