Top-seeded Romanian Halep lost the first set 6-2 in quick order as Ivanovic won five games in a row but responded in the second set which she dominated to take 6-1.
She looked to have surrendered the momentum to her opponent when trailing 3-0 in the decider but the 22-year-old did not drop another game as she remained on course for her sixth WTA title of the season with a 2-6 6-1 6-3 victory.
Stosur, the 2011 US Open champion, also needed three sets to overcome Anastasia Pavlyuchenkova.
The Australian roared through the first set, taking it 6-1, only for her opponent to suddenly find her form and take the second by the same margin.
But Stosur held her nerve to claim the crucial break and take the decider for a 6-1 1-6 6-3 success.
Halep told www.wtatennis.com: "I played really well when she had break points to make it 4-1 (in the final set), and I'm really happy with the way I came back in the end.
"I'm a little bit injured in my leg but I'm very happy I was able to win today. Now I'm going to rest and recover and I hope to just come back and enjoy the final tomorrow."