Zidansek, who will face American Madison Brengle in the second round, won 6-7 (1/7), 7-6 (7/2), 9-7 after three hours and 20 minutes.
Canada’s Andreescu, the injury-plagued 2019 US Open champion, had been a fitness doubt for the tournament after pulling out of an event in Strasbourg last Wednesday.
But she was forced into a gruelling deciding set against Zidansek, which saw the world number seven fail to serve out the match at 5-4 and then save a match point two games later.
Zidansek created two more match points in the 16th game of the third set and needed only one to wrap up victory.
The longest women’s singles match in French Open history remains Virginie Buisson’s first-round win over fellow Frenchwoman Noelle van Lottum in 1995, which lasted four hours and seven minutes.