I think the "XX inches/gallon" rule is an okay STARTING POINT to get a feel for stocking levels when planning the tank. But as far as using it as a hard-and-fast rule, that's a recipe for disaster. Certain fish need certain sized tanks, some fish are messier eaters than other, etc... Some books I've read quote 3 gallons per inch of fish, other say 5 gallons per inch of fish. (And that's full-grown inches... not how big they are now.)
Regardless, I think those 5 fish in the 24g kind of push it over the limit. I definitely wouldn't add more, and I'd be thinking about what one you want to take out if you start having problems.
Five fish in a 10g... no matter what kind of fish they are... is way too many for any long term plan.