So it's true that the correct answer is that if we want to differentiate f(x) with respect to another g(x) that we take $$\frac{f'(x)}{g'(x)}$$, but I think just calling this chain rule cancellation is not exactly correct (though it is both intuitive and also gives the right answer... lol).
To formalize things, let's say we have (1) $$f(t) = h(t,g(t))$$, which for simplicity in applying the multivariate chain rule we can write as $$f(t) = h(x(t), y(t))$$
So then (2) $$\frac{df}{dy} = \frac{dh}{dx}\frac{dx}{dy} + \frac{dh}{dy}\frac{dy}{dy}$$. We know that $$\frac{dx}{dy} = \frac{dt}{dg} = \frac{1}{\frac{dg}{dt}} = \frac{1}{g'(t)}$$, by the inverse derivative theorem, and we know $$\frac{dy}{dy} = 1$$.
So in (1) if we multiply $$\frac{dh}{dy}$$ by $$1 = \frac{g'(t)}{g'(t)}$$, we get (3) $$\frac{df}{dy} = \frac{\frac{dh}{dx}*1 + \frac{dh}{dy}\frac{dy}{dt}}{g'(t)}$$, since y=g, and then since x=t, we can write $$1 = \frac{dx}{dt}$$, which gives us
$$\frac{df}{dy} = \frac{\frac{dh}{dx}*\frac{dx}{dt} + \frac{dh}{dy}\frac{dy}{dt}}{g'(t)}$$, which is just $$\frac{f'(t)}{g'(t)}$$.