Let R be an associative ring with unit 1, and let \(a, b, c\in R\) satisfy \((ac)^{2}a=abaca=acaba=a(ba)^{2}.\) We prove that if \(\alpha =1-ba\) is generalized Drazin invertible, then \(1-ac\) is generalized Drazin invertible. This extends the results given by Chen and Abdolyousefi (Comm. Algebra, 49 (2021) 3263-3272) from Banach algebras to rings. Moreover, Jacobson’s lemma for generalized Fredholm elements relative to an ideal and Fredholm elements relative to a trace ideal is investigated in rings and in semisimple Banach algebras, respectively. Applying the above results, norm closure of hypercyclic operators is considered.