The proper English is “from each according to his ability, to each according to his needs.” It is also the original of the quote. When you PC it you render it nonsense. “His” is not exclusive to the male sex in a general reference except to to the feminists who are unhappy about all gender referent pronouns and adjectives.
from each according to zir ability, to
each according to zir needs.
that would be feminist approved the gender neutral pronoun for his is zir in the possessive sence.
not that I would actually use them but there is gender neutral pronouns for all the various sences of the regular pronouns.