Let $k$ be an algebraically closed field, and let $(\mathfrak{h},[\;,\;])$ be a finite dimensional abelian Lie algebra $k$. Let $(\mathfrak{g},[\;,\;])$ be a finite dimensional Lie algebra over $k$ such that $\dim(\mathfrak{h})\le\dim(\mathfrak{g})$. Given an embedding $\varphi:\mathfrak{h}\hookrightarrow\mathfrak{g}$, the universal property of the enveloping algebras induces a map $\varphi_*:U(\mathfrak{h})\to U(\mathfrak{g})$ which satisfies the following diagram:
$$\begin{array}{ccc}\mathfrak{h}&\hookrightarrow&\mathfrak{g}\\\downarrow&&\downarrow\\U(\mathfrak{h})&\rightarrow&U(\mathfrak{g})\end{array}$$
Not all maps of $k$-algebras $U(\mathfrak{h})\to U(\mathfrak{g})$ arise in this way, but I'd like to characterize those that do. What conditions $\star$ make the following statement true?
A map of $k$-algebras $f:U(\mathfrak{h})\to U(\mathfrak{g})$ is of the form $\varphi_*$ for some $\varphi:\mathfrak{h}\hookrightarrow\mathfrak{g}$ if and only if $f$ satisfies $\star$.
One could take $\star$ to be the condition that $f$ restricted to $\mathfrak{h}$ is an embedding into $\mathfrak{g}\subset U(\mathfrak{g})$, but this is sort of tautological. If finding an equivalent condition $\star$ is too difficult, I'd also be interested in necessary or sufficient conditions. For instance, I'm not even sure that $f$ must be injective.
There's no need to restrict attention to injective maps, the finite-dimensional case, or the case of an algebraically closed field.
If $\mathfrak{g}, \mathfrak{h}$ are any two Lie algebras, then a morphism of algebras $U(\mathfrak{g}) \to U(\mathfrak{h})$ is induced by a morphism of Lie algebras $\mathfrak{g} \to \mathfrak{h}$ iff it is in addition a Hopf algebra morphism with respect to the natural Hopf algebra structure on a universal enveloping algebra, where the comultiplication is given by extending $\Delta(X) = X \otimes 1 + 1 \otimes X$ and the antipode is given by extending $S(X) = -X$.
This is a corollary of the following. There is a forgetful functor from Hopf algebras to Lie algebras sending a Hopf algebra $H$ to its Lie algebra of primitive elements, those elements satisfying $\Delta(X) = X \otimes 1 + 1 \otimes X$. The Lie algebra of primitive elements of $U(\mathfrak{g})$ is known to be $\mathfrak{g}$. Moreover, the left adjoint of this forgetful functor is the universal enveloping algebra construction, and it induces an equivalence of categories between Lie algebras and a subcategory of the category of Hopf algebras (precisely the cocommutative conilpotent Hopf algebras).