The 36-year-old dropped her first set at the tournament in New York but came through to beat Estonia’s Kanepi 6-0 4-6 6-3 in 86 minutes.
“I made one or two crucial errors and that cost me the second set, at least cost me the first game,” Williams told reporters.
“It wasn’t that my level went down tremendously, it was literally one or two points which made a huge difference in that second set.
“Fortunately, I don’t really feel pressure because I’m on this journey of getting back to where I was and I’m kind of enjoying that to be honest.”
‘I’m going to continue to grind’
Williams had lost only 11 games coming into the fourth round and looked set to cruise into the last eight after winning the first set in 18 minutes, but the unseeded Kanepi fought back.
The six-time champion’s serve got her out of trouble, however, as she served up 18 aces to break her opponent’s resistance.
Should Williams, seeded 17th, win the US Open for a seventh time, she would equal Australian Margaret Court’s all-time record of 24 majors.
She withdrew from the French Open before her last-16 match with Maria Sharapova because of injury, while she was beaten by Germany’s Angelique Kerber in the Wimbledon final in July.
“That desire has not gone down at all and I don’t think it was capable of going up, because if it was at a 10, I felt I was at a 15 or a 20 and I’m still there,” said Williams of her will to win.
“I’m surprised it hasn’t come down to a 10. It’s still remained at that incredibly high level to compete and to want to win.
“It’ll be wonderful to win a grand slam while having a daughter but it’s a lot of work. It takes a lot of work to win those tournaments. I’m going to continue to grind and see what happens.”
Asked if she was considering having another child, Williams said: “I’ve obviously thought about having more kids and it will happen, God willing, in time.
“Right now is not the time. I’m thinking about playing tennis and enjoying this time with Olympia. I’ll have plenty of time in the future to add to the family.”
Williams vs. Stephens?
Williams could meet defending champion Sloane Stephens in the semifinals should she overcome eighth seed Karolina Pliskova in the last eight.
Stephens completed a 6-3 6-3 win over 15th seed Elise Mertens to set up a quarterfinal tie with Latvia’s Anastasija Sevastova.
Meanwhile, defending men’s champion Rafael Nadal beat Nikoloz Basilashvili Sunday 6-3 6-3 6-7 (6-8) 6-4 and will next face Dominic Thiem in the quarterfinals.
“It’ll be a tough one against Thiem. He hits the ball strong and has a big serve,” said the world No.1.