I'm trying to understand a step in a classic paper of Rankin. In Rankin's paper Contributions to the theory of Ramanujan's function $\tau(n)$ and similar arithmetical functions, he defines $$ b(n) := \sum_{d^2 \mid n} \lvert a(m) \rvert^2 d^{2k - 2},$$ where $k$ is a fixed integer. (Really, these are unnormalized coefficients of what we now call the Rankin--Selberg $L$-function $L(s, f \otimes f)$, including the $\zeta(2s)$ factor, but I think it suffices to think of $a(\cdot)$ and $b(\cdot)$ as arithmetical functions as I don't expect any special properties to be necessary.)
After equation 4.2.3 in his paper, Rankin claims that $$ \lvert a(n) \rvert^2 = \sum_{d^2 \mid n} b(n/d^2) \mu(d) d^{2k - 2}, $$ where $\mu(\cdot)$ is the Möbius function. This seems to do a form of Möbius inversion, and it seems closely related to typical Möbius inversion except there are squares.
How do you show that the first equation implies the second? And I guess it's true also that the second equation would imply the first?
And for a closely related question: is there an interpretation of this form of Möbius inversion through Dirichlet series?