The magnetic field from a magnetic dipole is the same as from a current loop, and has the same form as the electric field from an electric dipole. The magnetic field along the axis of the magnetic dipole is proportional to $1/x^3$ [1].

In the case of the electric dipole, the fields from each charge are proportional to $1/x^2$ and cancel to 1st order of approximation if they are close together, leaving the 2nd order effect which is proportional to $1/x^3$.

If the magnetic field is uniform at the 2nd loop, there is no force on it, only a torque. When the magnetic field varies with distance there is a force (in addition to the torque) on the 2nd loop, equal to $F=\mu .\frac{\partial B}{\partial x}$ where the dot indicates scalar product [2]. This force either pulls the loops (dipoles) together or pushes them apart. The magnetic field from loop 1 varies as $B(x) \propto 1/x^3$ so the force of attraction (or repulsion) on loop 2 is also proportional to $1/x^4$.

Likewise, the force of attraction/repulsion between 2 electric dipoles is proportional to $1/x^4$.

[1] http://www.physicsinsights.org/dipole_field_1.html

[2] http://www.physicsinsights.org/force_on_dipole_1.html