Let $\mathfrak g_1,\mathfrak g_2$ be finite-dimensional real or complex Lie algebras such that ${\rm Der}(\mathfrak g_1)$ and ${\rm Der}(\mathfrak g_2)$ are isomorphic as Lie algebras, where ${\rm Der}(\mathfrak h)$ denotes the algebra of derivations of the Lie algebra $\mathfrak h$.
In that case, is it true that $\mathfrak g_1$ is isomorphic to $\mathfrak g_2$?
I tried to find some reference dealing with that question, but couldn't. Since it's a very simple question to ask, I believe this probably means the answer is 'not necessarily'. However, I was not able to find, or to produce, a counter-example for it either.
If the answer is 'yes', can you sketch the argument or point out some reference for that? If the answer is 'not necessarily', can you describe a counter-example?