Well since he's 5 and very intelligent I think you have a good chance of helping him understand this without hurting his wee little pride. smile
I would suggest you wait until he is playing with some other five year olds and pay attention to when one of the others does something totally obnoxious, including, but not limited to bragging. Since they are five, you shouldn't have to wait too long. wink
Then just unassumingly pull him aside and quietly talk about what the other child did and ask him how he felt about it. Especially if DS concurs that this child was not nice and he didn't like it, wholeheartedly agree with him.
Then kind of casually pipe in about bragging(not just about being smart, it could be bragging about anything) and remind him that he doesn't like hearing it from other children, so they probably feel the same way if he were to brag about (insert recent example.)
Gently. This way you can use a normal 5 year old scenario as a learning example, but the finger is pointed at another child so it's less ego-defeating. smile
The key is to make sure it's done very quietly and to the side, so none of the children become to embarrassed. blush
I've found with DD5 that I need to repeat this excercise many times, cry but with DD8 she's usually good with only one attempt.
I hope this is helpful.