Necessary and sufficient conditions for your question to have a positive answer are that $A$ be $\textit{unmixed}$, that is, every associated prime is a minimal prime, and $\textit{equidimensional}$, that is, $\mathrm{dim} (A/\mathfrak{p}) = \mathrm{dim}(A)$ for every minimal prime $\mathfrak p$. Charles Staats' example is not equidimensional. The one-dimensional ring $A=k[x,y]/(x^2,xy)$ is not unmixed, and $A/(y)$ has dimension zero. Sufficiency follows from the fact that the set of zerodivisors of $A$ is equal to the union of the associated primes.