Let [Formula: see text] be a prime ring, let [Formula: see text] be a noncentral Lie ideal of [Formula: see text] and let [Formula: see text] be two generalized derivations of [Formula: see text]. In this paper, we characterize the structure of [Formula: see text] and all possible forms of [Formula: see text] and [Formula: see text] such that [Formula: see text] for all [Formula: see text], where [Formula: see text] are fixed positive integers. With this, several known results can be either deduced or generalized. In particular, we give a Lie ideal version of the theorem obtained by Lee and Zhou in [An identity with generalized derivations, J. Algebra Appl. 8 (2009) 307–317] and describe a more complete version of the theorem recently obtained by Dhara and De Filippis in [Engel conditions of generalized derivations on left ideals and Lie ideals in prime rings, Comm. Algebra 48 (2020) 154–167].