Let $\mathfrak{g}$ be solvable Lie algebra. Lie’s theorem states, that adjoint representation is a homomorphism $\operatorname{ad}:\mathfrak{g}\to \mathfrak{t}$, where $\mathfrak{t}$ is an algebra of upper-triangular matrices. Let $\mathfrak{d}\subset\mathfrak{t}$ be a subalgebra of diagonal matrices.
Is it true, that $\mathfrak{g}$ is nilpotent iff $\operatorname{ad}^{-1}(\mathfrak{d})=Z(\mathfrak{g})$? In one direction it is exactly the Engel’s theorem, but I cannot find counter examples or proof for the other direction.
UPD I want to rephrase my question in an equivalent way. Is it true, that all solvable, but not nilpotent subalgebras of upper-triangular algebra contain nonzero diagonal elements?