The 16-year-old Hsing, who has gained attention because of her friendship with billionaires Bill Gates and Warren Buffett, defeated Ni 4-2 and will now face second-seeded Li Xiaoxia in the third round.
Li is among the gold-medal favourites along with Chinese teammate Ding Ning.
"I really respect her as a player and I think she's amazing," Hsing said. "She's one of my idols. But I'm just going to go for it. I think skillwise she's much better than me and she has a lot more experience than me. But it's going to be her first match at these Olympics, and from my experience it is so nerve-racking."
Hsing was to play Li later on Sunday, which she didn't know until a reporter told her.
"Do I really?" she replied.
Moments later it was confirmed.
"Oh my gosh," she added.
Hsing had match point in the fifth game, but hit a long ball to lose the game. She came back in sixth and won it 12-10 to take the best-of-7 game series 4-2.
"At that point of losing (the fifth game) I really had to block out being so close and focus on the present."
Hsing, a senior-to-be at Christian Valley High School in San Jose, California, said she didn't know if Gates or Buffett would arrive to watch her play.
Rumours have been swirling around the venue that Gates may show. Buffett has said earlier he couldn't make it.
Buffett met Hsing when she was only 9 and two years later invited her to play against shareholders at Berkshire Hathaway's annual meeting. She returned earlier this year after winning a spot on the U.S. team and took a few points off Buffett and Gates.
She refers to the two as "Uncle Warren" and "Uncle Bill."
Hsing had talked about using the London Olympics — her first — as preparation for the Rio de Janeiro Games in four years. But her time has come sooner than expected.
The 49-year-old Ni is a two-time European champion and was a world champion playing for her native China 30 years ago.
"Of course when I was 19 I was a world champion," Ni said. "But times are changing and she's playing well."
Hsing was born in the U.S. to parents who emigrated to the country two decades ago. Her father Michael is from Taiwan and her mother Xin Jiang was born in China.
Table tennis will get serious later Sunday and Monday with the top 16 men and women's singles players swinging into action.
China, where table tennis is a national pastime, has won 20 of 24 gold medals since the sport was added to the Olympics in 1988 in Seoul. The Chinese are expected to sweep all four gold medals again, two in singles and two in team.
Follow Stephen Wade at https://twitter.com/StephenWadeAP