Just thought you would like to read the advise from another thread about shyness, maybe it will be helpful despite the age/situational difference. http://www.mamapedia.com/questions/802647973984010241
Also, I would tell you to teach your son to embrace his differences. If he is smart or known as the "smart kid," help him to understand that there is nothing wrong with that. Maybe you could make/help him to realize that he has a gift for learning and excelling. I know it sounds way beyond a five year old but maybe he could be more of a helpful type, helping the other children with their difficulties as opposed to being the outcast for being smart. Some children who excel tend to regress in social situations, you already see that. So teach him how to use it to his advantage. If he wants to be included you are going to have to teach him to stand up and ask for what he wants. He cannot sit in the corner and expect the other children to come over to him, he has to go to them. Maybe those children went through preschool together and they are familiar, or live in the same neighborhood. Teach your son to introduce himself and ask if he can join in. I don't believe that a smart kid cannot be popular. He will sense his differences don't lead him in that direction subconsciously. If you say those things to others they will treat him as so. Talk to him about being smart and about being shy.