That may work, but only while you're not focusing on the man as well (eg. will not work right before you pickpocket the man, while the player is focusing the man).
What you could do instead is simply check if your own player is under attack. If both you and the man are under attack, you'll be the one attacking him. If the man is under attack, but you are not, then it's probably someone else.