Not sure how to help with the mess, but have you ever seen how your kids apply the toothpaste? Do they touch the bristles of the brush directly to the toothpaste tube? I've been told that this is a great way to transfer germs from one kiddo to another. If they do this, you might want to get each kid their own toothpaste.
Also, if each has their own uniquely identifiable toothpaste (pink, sparkles, gel, etc.) you could easily identify the messy culprit. Your 5 yo is old enough to send in with a rag if he makes a mess. A few times cleaning up may discourage him from doing it again. You might look at some of the kids' toothpastes that are not in a tube, but in a stand-up bottle like colgate for kids.(I think Crest makes some too.)