$AB - BA = \lambda B$ has a nontrivial solution, iff $\lambda = \lambda_i - \lambda_j$?
If $E$ has eigenvalues $\lambda_1, \ldots, \lambda_n$, then $B \mapsto [E,B] = EB - BE$ has eigenvalues $\lambda_i - \lambda_j$.