It's a perfect chance for you to see her interest level in you. Instead of watching the guy you secretly want to jack in the face, focus on her. See her reaction, see how she turns him down (assuming she does). Look for the same IOIs you would look for if you had just approached her.
If she tries to handle it herself and he's persistent, that's when I would interfere. At that point, don't get all pissed, but be firm and make it clear that he needs to walk away.
I met a friend of a friend last night for the first time (so not at all like "my girl", but still works). We were dancing a little while later and this guy puts his hand on my shoulder and says "excuse me, let me get in here". I simply ignored him and kept dancing, waiting to see her reaction. She SOUNDED interested to him, saying how cute that was and all that. But as she said that, she tightened her grip around me and kept me between her and him, as she just looked around my shoulder to talk to him. At that point, it was easy for me to just lead her over to the side and that was that. Well, not before the guy came back up to me and kept apologizing, to which I just told him to have a good night.
Just stay firm, don't look bothered by it. We can throw tons of "lines" out there you can use, but it's all situational and it just works best to be confident; whether that's letting her handle it at first, or you stepping in to get him to leave.