Let $R$ be a prime ring of char $R\ne 2$ with a nonzero derivation $d$ and let $U$ be its noncentral Lie ideal. If for some fixed integers $n_1\ge 0, n_2\ge 0, n_3\ge 0$, $( u^{n_1}[d(u),u]u^{n_2})^{n_3}\in Z(R)$ for all $u \in U$, then $R$ satisfies $S_4$, the standard identity in four variables.