Welcome to the forum and well done on your achievements so far!
I reckon as long as your goal is just to finish the run but not in any specific time then ye, 5 weeks for a 10k run should be fine. Don't push yourself to hard though otherwise you may injure yourself and then you wont be able to run the 10k at all!
Slow and steady
Are your friends at the same fitness as you or have they been running for a while? If they have been running for a while don't get pressured in to running faster than you are comfortable with, run the race as if you were the only person doing it, enjoy it, don't kill yourself to keep up with others.
O.