As a Corollary of Gauss's Lemma, we know that if $D$ is a UFD, and $f(x)\in D[x]$ is a polynomial that is primitive (a gcd of the coefficients is $1$), then $f(x)$ is irreducible in $D[x]$ if and only if $f(x)$ is irreducible in $K[x]$, where $K$ is the field of fractions of $D$.
You can view $ZY^2+Y+Z^3+Z^2-1$ as an element of $(\mathbb{Q}[Z])[Y]$. Since $\mathbb{Q}[Z]$ is a UFD, and this polynomial is primitive as a polynomial in $Y$ ($\gcd(Z,Z^2-1) = 1$), then it is irreducible in $\mathbb{Q}[Y,Z]$ if and only if it is irreducible in $\mathbb{Q}(Z)[Y]$, where the polynomial is quadratic. In order to be reducible there, it has to have a root, and the roots are given by the quadratic formula. The discriminant is $1 - 4Z(Z^3+Z^2-1) = -4Z^4 -4Z^3 + 4Z + 1$ which would have to be a perfect square in $\mathbb{Q}(Z)$, hence (by the rational root theorem) a perfect square in $\mathbb{Q}[Z]$.
But in $\mathbb{Q}[Z]$, any perfect square has positive leading coefficient; so this element is not a square in $\mathbb{Q}[Z]$; since the discriminant of the polynomial is not a perfect square, the polynomial has no roots in $\mathbb{Q}(Z)$, hence is irreducible in $\mathbb{Q}(Z)[Y]$, and therefore is irreducible in $\mathbb{Q}[Y,Z]$.