Watched by her family in the stands, Williams lost a tight first set before tying in Game Two on Center Court, the site of seven of her 23 Grand Slam titles.
She was separated in the third set, but Tan showed her resilience by fighting back to take a thrilling final set at the tiebreaker.
Asked if this would be the last Wimbledon match of her decorated career, Williams said that was a question she “cannot answer”.
“Who knows where I will appear?” She added.
On Tuesday, she returned to the long-awaited singles, one year after retiring for her last first-round match at Wimbledon.
Momentum shifted between the players over the course of the three-hour, 11-minute standoff – first in Tan’s favour as she clinched the first set, then toward Williams as she advanced into the second.
It looked as if the 40-year-old Williams would win in the playoff as she served up the win, but the memorable comeback was not.
Tan came back to break at 5-5, and despite failing to convert the match point at 6-5, she made no mistake when she had a second chance in the tiebreak.
Ranked 115th in the world, Tan was playing in her first major draw match for Wimbledon and ninth in all major tournaments.
“When I saw the draw, I was really scared,” she said after the match. “It’s Serena Williams – she’s a legend. I was like, ‘Oh my God, how can I play?’ “And if I can win one or two matches, that’s really good for me.”
Under the center-court spotlight, Tan comfortably did more than that – triumphing over one of the greatest athletes the sport has ever seen.
“For me at the first Wimbledon, it’s great. Just awesome,” she added, struggling to find the words to capture her feelings.
It remains unclear if this will be Williams’ final at Wimbledon. When asked to summarize her championship legacy, she was terse, if understated.
“I think I’m pretty strong on the grass,” she said. “Maybe not today, but he’s very strong there.”
Nadal, Swiatek presents
In the matches played earlier on Tuesday on Center Court, there were wins for French Open champion Rafael Nadal and Ega Swiatek.
Two-time Wimbledon winner Nadal escaped in fear to defeat Francisco Cirondolo 6-4 6-3 3-6 6-4 as he began his quest for a Grand Slam title, while Swiatek recorded her 36th straight win with a win. Jana Fit 6-0, 6-3.
Nadal, who missed last year’s tournament due to injury, received a standing ovation on Central Court, where he was put to a rigorous test by Argentine Serondolo.
The Spaniard looked on his way to a routine win when he was 2-0 and broke in the third set, but the free-swinging Cerondolo fought back with a double break to win the set.
It looked like the match was headed for the playoff when the world number 41 broke for fourth, but Nadal saved his best until last and sealed the win with a double-break.
Meanwhile, Swiatek dominated the first set against Fett in her first match since the French Open, but had to overcome a tough second in the second when Fett came close to securing a double break.
The top seed recovered from a poor start to the group and went out five games in a row, increasing her win to 36 matches.
“Typical food guru. Problem solver. Devoted beer practitioner. Professional reader. Baconaholic.”