Let $R$ be a prime ring, $Q_r$ its right Martindale quotient ring, $L$ a non-central Lie ideal of $R$, $n\geq 1$ a fixed integer, $F$ and $G$ two generalized skew derivations of $R$ with the same associated automorphism, $p\in R$ a fixed element. If $p\bigl(F(x)F(y)-G(y)x\bigr)^n=0$, for any $x,y \in L$, then there exist $a,c\in Q_r$ such that $F(x)=ax$ and $G(x)=cx$, for any $x\in R$, with $pa=pc=0$, unless when $R$ satisfies the standard polynomial identity $s_4(x_1,\ldots,x_4)$.