As you may already know, you will need them to log in to use the phone. The good news is that even though they can't remember their password, they can reset it.
Please have your friend go here: https://iforgot.apple.com/password/verify/appleid
Enter their Apple ID information and follow the prompts to reset their password. Use the new information on the iPhone 5 to remove the lock.
If you can take a minute and use the rating system to rate our session as 3 stars or higher and press Submit so I am credited with helping you.
I have not heard back from you in a while -- If the issue is resolved, please rate our session as 4 stars or more and press Submit so I am credited with helping you otherwise please reply back so we can continue with the issue.