Let consider $\mathbb Z[X]$. First, do we agree that this ring is not principal (and even not UFD ?).
Now, I'm tring to show that $(5,X^2+1)/(5)\cong (X^2+1)$. So, to me $(5,X^2+1)=(5)+(X^2+1)$, is it true ? If yes, I get that $$(5,X^2+1)/(5)=5\mathbb Z[X]+(X^2+1)\mathbb Z[X]+5\mathbb Z[X]=(X^2+1)\mathbb Z[X]+5\mathbb Z[X]=(5,X^2+1),$$ where is my mistakes ?
$(a,b)=(a)+(b)$ is true for any ring.
"where is my mistakes ?" You've changed which ring your ideals are part of. $(5,X^2+1)/(5)$ is an ideal of $\Bbb Z[X]/(5)$, while $(5,X^2+1)$ is an ideal of $\Bbb Z[X]$, and as such the two ideals aren't immediately comparable. The intermediate terms in your calculation could be in either ring, which is probably where the confusion comes in.