You definitely wouldn’t be able to do that for meet.jit.si; it would be a privacy issue if it were possible to query for participant names without joining a room.
For JaaS, I’m afraid I don’t use it much so can’t tell you what the best way is. But one option might be to subscribe to participant events using webhooks, and in your own backend you can then infer who is in which room at any given time.