World number one Osaka looked to be heading out when she trailed Vekic 5-1 in the deciding set, despite earlier taking the opener in confident fashion.
But the two-time grand slam champion dug in and came out a 6-3 4-6 7-6 (7-4) winner, setting up a meeting with Anett Kontaveit.
After misunderstanding a question relating to her struggles in the match, Osaka took aim at those who suggested she has gone off the boil since winning the Australian Open at the start of the year.
"I'm just going to say it because whatever. I might get in trouble, but it's okay," she told a news conference.
"I don't understand why people are saying I'm having a bad season if I won the Australian Open. Last year I didn't win the Australian Open.
"Sure, I didn't win Indian Wells but I still thought I did pretty good there, and at Miami. I'm here now, so sometimes I hear people say, 'Naomi's struggling there', and I'm like 'yo'."
Kontaveit had also appeared to be in trouble when she lost the first set to Victoria Azarenka, but she fought back to level the match.
The eighth seed then led 3-0 in the third when Azarenka was forced to retire.
Kiki Bertens will meet Petra Kvitova in Saturday's other tie, with the former beating Angelique Kerber in straight sets.
Meanwhile, Kvitova came through a testing clash with Anastasija Sevastova 2-6 6-2 6-3 to book her spot in the last four.
At the Istanbul Cup, Petra Martic needed three sets and two tie-breaks to remain the only seed left in the draw, defeating the dangerous Kristina Mladenovic 7-6 (7-4) 4-6 7-6 (7-2).
Margarita Gasparyan won an all-Russian tie against Veronika Kudermetova, while Czech pair Marketa Vondrousova and Barbora Strycova both triumphed in their quarter-finals.