This is an instance of <a href="https://en.wikipedia.org/wiki/Quintuple_product_identity">Watson's quintuple product identity</a> (also Macdonald identity for $BC_1$):
$$\prod_{n\geq 1}(1-s^n)(1-s^nt)(1-s^{n-1}t^{-1})(1-s^{2n-1}t^2)(1-s^{2n-1}t^{-2})=\sum_{n\in \mathbb Z}s^{\frac{3n^2+n}{2}}(t^{3n}-t^{-3n-1}).$$
By plugging in $t=x^{-1}$ and $s=-x^{4}$ this becomes exactly your identity.