Let RR be a prime ring with the extended centroid CC, LL a noncommutative Lie ideal of RR and gg a nonzero bb-generalized derivation of RR. For x,y∈Rx,y∈R, let [x,y]=xy−yx[x,y]=xy−yx. We prove that if [[⋯[[g(xn0),xn1],xn2],…],xnk]=0[[⋯[[g(xn0),xn1],xn2],…],xnk]=0 for all x∈Lx∈L, where n0,n1,…,nkn0,n1,…,nk are fixed positive integers, then there exists λ∈Cλ∈C such that g(x)=λxg(x)=λx for all x∈Rx∈R except when R⊆M2(F)R⊆M2(F), the 2×22×2 matrix ring over a field FF. The analogous result for generalized skew derivations is also described. Our theorems naturally generalize the cases of derivations and skew derivations obtained by Lanski in [C. Lanski, An Engel condition with derivation, Proc. Amer. Math. Soc.118 (1993), 75–80, Skew derivations and Engel conditions, Comm. Algebra42 (2014), 139–152.]