It's a pretty simple trick that my friends and I have been using since wow's launch. Basically if you /who (name) of someone on the other faction and they're online it will tell you target is unfriendly, if they're offline it will say player not found.
Works great if you're camping someone, so you know when they're getting on their high level for example. Or just to know when it's time to move on for that matter.