But when the UN started up, they had about 40 charter members, right? And how many other "star nations" besides United Earth, Tellar, Andor, Vulcan, Romulus, and Qo'noS were there on the field, known to one another?
ENT and earlier series have established that there were plenty of other, smaller worlds active on the interstellar stage (for instance, in the Interspecies Medical Exchange) in the 2150s, even if they weren't as powerful as the ones you list. There's Coridan, there's the Rigel system, there's Draylax, there's Vissia, there's Risa, there's Axanar, there's Paragaan, there's Tandar, there's Delta, there's Xyrillia, there's Ithen, there's Mazar, there's Tiburon, there's Dekendi. And there are worlds whose distance from the Federation core may not be far, including Bolarus. Plus, there are worlds that may have declared independence from Earth very early on and established themselves as independent polities, including Mars, Alpha Centauri, and Deneva.
Any number of these worlds could have joined the Federation in the early years after the Founding. I personally like to imagine that Denobula was the first world after the initial five to join.