Kanepi won the first set and built a 2-0, 40-15 lead in the deciding set. She also earned multiple break points in the eighth game, which if converted would have given the Estonian a 5-3 lead.
Yet Martic, appearing in the second week at Roland-Garros for the third time, rallied in the hot summery conditions to outlast the former world No.15 5-7, 6-2, 6-4.
She stirred up the crowd on Chatrier with her celebrations following some epic rallies, and they received her warmly as she clinched victory in two hours and 12 minutes.
"It was tough mentally for me today, especially because I was stopped four times before in the fourth round (at Grand Slams), so it really felt like I was doubting whether I was ever going to get that fourth round (win)," Martic said.
"That was close, two years ago. I was two points away (against Elina Svitolina). Didn't happen. Today it played a role in my mind. It was not always easy to focus on my game, but I just tried to fight as hard as I could, and thank God, I finally made it."
Vondrousova, conversely, required less than an hour to see off a listless Sevastova.
The 19-year-old left-hander brushed aside her more experienced opponent 6-2, 6-0, with the second set lasting just 21 minutes.