Can we make sense of $\frac{\partial f(x_1, x_2, \dots, x_n)}{\partial g(x_1, x_2, \dots, x_n)}$?

The construction you described doesn't actually work on manifolds - $g'(t)$ (or $dg$ as we would normally write) is not a tangent vector, but a cotangent vector; so the directional derivative $\nabla_{dg} f$ doesn't make sense without a metric (or some other additional structure) to identify $TM$ with $T^* M$.

It also doesn't seem to have the right behaviour to be casually called "$\partial f / \partial g$" - for example, $\nabla_{dg} f$ would double if you doubled $g$, which is the opposite scaling behaviour to what the notation would suggest.

Remember that partial derivatives are only defined in terms of a whole coordinate system - if you're given the two coordinate systems $(x,y)$ and $(x,z=y-x),$ the expression $\partial f/\partial x$ will have different values depending on whether you're holding $y$ or $z$ fixed! Thus I'm unsure how to interpret the intended spirit of "$\partial f/\partial g$".

Is this a well-known idea? If so, what is it called?

Not commonly enough to have a name; but it's a simple enough expression that you'll find it cropping up in equations here and there in vector calculus (as $\nabla g \cdot \nabla f$) and Riemannian geometry (as $\nabla_{\operatorname{grad}g}f$). The interpretation isn't really close to what you're looking for, however - it's just "the rate of change of $f$ in the direction $\nabla g$ (or vice versa).

what I am actually interested in is to find a new function which tells me "how to move f infinitesimally so we can make it closer to g".

I'm unsure how to interpret this - to me, the way to "move" a scalar function is to deform it by another scalar function (e.g. deform $f$ to $f + \epsilon \phi$ for a parameter $\epsilon$), in which case what you're describing would just be the scalar $g - f$? If you could formalize what you're asking for here (or at least give more of a geometric description) there might be something more useful to say.