Let R be a prime ring with extended centroid C and maximal right ring of quotients Q. Set [y,x]1=[y,x]=yx−xy for x,y∈Q and inductively [y,x]k=[[y,x]k−1,x] for all integers k≥2. Suppose that L is a noncentral Lie ideal of R and f:L→Q is an additive map satisfying [f(x),x]n=0 for all x∈L, where n is a fixed positive integer. It is shown that there exist λ∈C and an additive map μ:L→C such that f(x)=λx+μ(x) for all x∈L except when charR=2 and R⊆M2(F), the 2×2 matrix ring over a field F. This result naturally generalizes the classical theorem for derivations by Lanski and the recent theorem for X-generalized skew derivations by De Filippis and Wei. Moreover, it gives an affirmative answer to the unsolved problem of such functional identities raised by Beidar in 1998.