I'd talk to your son about it and ask him what he wants to do. Explain that it's his choice whether he goes or not, and ask him to think how he might feel when he's picked up. If he'd rather do some of the party or none, and maybe you could celebrate with birthday boy another time.
Depending on his response I'd be honest and say " SON will struggle about going home when the other boys get to stay, so I think we'll give the party a miss and maybe we can get the boys together to celebrate x's birthday another time".
This happened recently to my daughter, the girl she considers her best friend had a party and then invited 2 girls back for a sleepover. However, although she was hurt (a) it was 2 girls out of 10 and (b) it was handled very discreetly, so as it was a bounce party, the 2 girls simply went home with the birthday girl and it wasn't a big deal.
If it had been at her house and the other 8 were staying I wouldn't have let her go as that would have really upset her.
I think the other mum has been very callous of the 2 boys' feelings. Do you think something might have happened to precipitate this? Have the boys had an argument or something?
If your son wants to go, maybe talk to the mum of the other boy not invited and do something with the 2 of them together that's super cool - or they could have their own sleepover together?
I do think sometimes that parents are cruel and thoughtless. If you have a big house and can fit 7 in, you can fit 9. That's really mean of the mum.