J.W.
Sorry. It sounds like he is looking for attention. He understands the family dinamic at home and is okay. It's just when their are a lot of adults around he wants attention, to be treated special. He then acts out his pent up aggressions on his cousin. My son did the same thing at 5, when my daughter was about 5months. He was okay with everyone else. It's like he knew that his cousin wasn't an enemy, just he was where he wanted to be(his normal) with out his sister, and lashed out by biting. Saddly he continued this 3 or 4 more times, before his cousin bit him back. Not that it is a good thing at all to be biting, but when he was the one on the recieving end, he knew it had to stop. Then came the tears and the complaints that although he loved his sister, he missed being an only child. Hopefully your son won't bite again, and it won't lead to him recieving the bite. But some kids don't learn unless they have it done to themselves. Like the lesson do unto others as you would have them do unto you. Really that to a child is just words, until they are on the recieving end. I don't know what to tell you to do. But it eventually will end. All kids at some point try to bite others. It may be they can't verbalize the feelings they have. Give him some extra attention when their are others around. Be a little more strict, as far as what behaviors you let slide. Like if he jumps on the furniture when their is company (a no no) punish him,(for a while) where before you let it slide. Just so he knows that his behavior is being watched, and bad behavior is not tollerated biting included. See how much his behavior has changed, how many little things that you brush off really are there? More than usual? It may just be the whole thing of not being able to express himself about his feelings. And his cousin just seemed the way to do it. My son did grow out of it. I felt the same as you helpless, and sorrowful for the biting.
I am now a mother of 3, and we find ways of coping with feelings-music, drawing, and car ride talks. You can't do much else in the car. It has become a 'safety zone'. What is said/felt in the car stays there. It's major sense of relief for my oldest son, now almost 7. He is 5 years older than his sister, and 6 to his brother. A gap that has in itself many challenges, so time to talk is a must. Car rides do work. I know your children aren't as far apart as mine, but try anything. It could help.
I really hope all works out for you.