Ivanovic, the Roland Garros winner in 2008 and a former world number one, started well on the Suzanne Lenglen showcourt but her game deteriorated and, at one stage in the final set, she hit three double faults in a row.
Errani, seeded 21st while Ivanovic was number 13, served well and won points at the net before taking victory on her second matchpoint when the Serbian put a forehand wide.
Errani will now meet either third seed Agnieszka Radwanska of Poland or 26th-seeded Russian Svetlana Kuznetsova, another former champion.
(For more sports news and updates, follow Ahram Online Sports on Twitter: @AO Sports)
Short link: