The simple way to decide is to think that there is a word in your sentence which you left out. If it is an inanimate object, use the gender of the word which is missing.
a) Ein Messer von den Messern → Eins von denen
b) Ein Löffel von den Löffeln → Einer von denen
c) Eine Gabel von den Gabeln → Eine von denen
As pointed out in the comments, denen is colloquial, use von ihnen in a more official context.
When it comes to entities which have their own “non-grammatical” gender, you use the gender of the entity you are referring to.
a) Ein Arzt von den Ärzten und Ärztinnen → Einer von denen
b) Eine Ärztin von den Ärzten und Ärztinnen → Eine von denen
If you don’t mean to refer to one specific entity of the group, but mean any of them, use the generic singular genus for that group.
c) Irgendein Arzt oder irgendeine Ärztin von den Ärtzen und Ärztinnen → Einer von denen
d) Irgendein Kater oder irgendeine Katze von den Katern und Katzen → Eine von denen
If you need to emphasize political correctness when referring to humans, you could use oder. This makes it quite clumsy, and is unlikely to be found outside of the writings of organisations who actively promote gender equality.
Irgendein Arzt oder irgendeine Ärztin von den Ärzten und Ärztinnen → Einer oder eine von ihnen
Choosing an unexpected reference group might be grammatically correct, but it is likely to be misunderstood.
Irgendeine Person von den Personen → Eine von denen → Eine Frau von den Frauen und Männern
If you haven’t introduced the word Person recently in the conversation, your conversation partner will automatically assume that you are talking about case 2, with the group consisting of “Frauen und Männer”. And because 2a) and 2c) both result in the choice of the male gender, he’ll think that this is case 2b), a specific female human, not 2c), a random person of any gender.
Update After reading user unknown's answer, I realized that there is a case I forgot to describe. Added here for completeness.
- If in the flow of conversation, you previously referred to the group with a plural substantive describing the role of its elements, use the gender of this substantive in singular. This applies to both animate and inanimate entities. The requirement is that the substantive itself does not change gender depending on the role.
a) You get asked "War es eins von den Utensilien da?" . The answer is:
Ein Utensil von den Utensilien → "Ja, eins von denen"
You use the gender of Utensil even though each individual fork would require die and each individual spoon would require der.
b) The regulations of a political party might state "Eine Kommission muss aus mindestens vier Parteimitgliedern bestehen." The next sentence says that they need to designate a chairperson.
Ein Mitglied von den Mitgliedern → "Eins von ihnen muss zum Vorsitzenden ernannt werden."
Even though all the members of the committee are men and women, you use the gender of "Mitglied", which is neuter.
If a substantive is already introduced, but it changes gender depending on the role (Arzt/Ärztin, Vorsitzender/Vorsitzende), use rule 2.