Ok so - you are the mummy to beat imho so this is all just suggestions, you'll know best by far
a mix of the following or one / none:
Talk to him. Very sensibly, explaining why you are worried about his manner / tone / etc. Explain he's such a grown up boy but started behaving very silly or you're worried something is wrong or you simply don't like being spoken to rudely as you don't talk to him like that and it upsets you... which ever angle tugs the heartstrings...
Hmmm- tricky to explain and you will have heard it all before, but some kind of rewards / punishments. Something that can be quantified and - where ever possible - positive rather than negative ('gaining' rather than 'losing') although if taking away privileges is the only way then 1) make sure it's explained and a time-scale given for return and 2) you don't end up with nothing left to take away
Slyly - I mean - cleverly - encourage his friends that you do approve of. Ask them to dinner / sleep over / out at the weekend / shopping / footie (and be actively involved in their play even if they don't know it like providing erm a new cheapie football or suggesting going to the shops with a list each of stuff to find) he may well grumble but could just start to have a subconscious effect! Try with more than one classmate too.
This will sound a bit blunt and harsh
start ignoring him when he wants your attention for something or a similar 'rude' action he will notice - and say "but that's what so-and-so's
mother does". Can work with the world-ly wise of the kiddiewinks, if they really start down the track of copying and using it as an excuse for how they behave - and can then, when you've done it a few times, hopefully lead to a good talking to about how we are our own people, make our own choices, know right from wrong etc.
Depending how things go - talk to his teacher. Just voicing your concern will help you - you may find that they are sitting at the same table in class or that she has concerns too; or that she can calm your worries even by reassuring you that in school he behaves well etc.
^ hopefully that's not too much ramble, I obv don't have a 5 y/old but have met a fair few in my time
The rewards / sanctions is the hardest as it has endless possibilities and (at least at first) needs to be strictly adhered to for it to work best. Not an easy task with hands already full!!
Pm if can share any more wandering thoughts, hope all else is well with you
xx