We describe a new method to estimate the mass of black holes in Ultraluminous X-ray Sources (ULXs). The method is based on the recently discovered ``variability plane, populated by Galactic stellar-mass black-hole candidates (BHCs) and supermassive active galactic nuclei (AGNs), in the parameter space defined by the black-hole mass, accretion rate and characteristic frequency. We apply this method to the two ULXs from which low-frequency quasi-periodic oscillations have been discovered, M82 X-1 and NGC 5408 X-1. For both sources we obtain a black-hole mass in the range 100~1300 Msun, thus providing evidence for these two sources to host an intermediate-mass black hole.