The wiki page says that the above implication holds if the ideals are prime. Here the multiplicative set $S$ contains $1$ but not $0$ and we are on a commutative ring $A$.
What can we say about the implication? And when the case is for prime ideals, how do I prove the implication?
Note that as commented below, we assume that $I_1, I_2$ are proper ideals.