There are several detection methods in fact. The one you have pointed out is one; another common one is when you see that an interstellar gas cloud is happily and uneventfully gliding along, and then all of the sudden it stumbles upon something that attracts gas and dust with so much force that it compresses it to the point where it actually starts radiating far high in the X radiation spectrum. There are some oddballs, too; for instance, you see stars orbiting what should be a pair in a binary system, there is a clear radiation in the X radiation spectrum (due to gas being drawn from the other star), but you cannot trace it back to a companion object and the orbital parameters cannot be those of some other object (like a neutron star).
Really massive black holes have been thought to be located in some galactic nuclei only after black holes have been seen in other places.