That sounds like it's exactly the problem. I would have your friend contact [email protected] with your username and email address (along with his) to straighten it out. I don't think you'll be able to do it on your own, as you could effectively steal another person's game if that was the case.
In the future, I believe there's an option at checkout to purchase it as a gift that can be selected.