Let the sides of the rectangle, in $\mathrm{cm}$, be $4x$ and $5x$.
Then the area of the square is $4x \times 5x\;\mathrm{cm}^2 = 20x^2\;\mathrm{cm}^2$. So $20x^2 = 125$, that is $x^2 = \frac{25}{4}$. Therefore $x = \pm\frac{5}{2}$, but $x$ cannot be negative so $x = \frac{5}{2}$ and so the sides of the rectangle are $10\;\mathrm{cm}$ and $12.5\;\mathrm{cm}$.
Hence the rectangle has perimeter $45\;\mathrm{cm}$.