Since grammatical gender is pretty much a dead issue in English the two words have become conflated. The lurking prescriptivist in me dislikes the use of gender to refer to the presence or absence of a Y-chromosome. The descriptivist in me shouts that sex has primarily come to refer to the physical act, making its use in referring to the presence or absence of a Y-chromosome somewhat suspect.

But let us not be deterred! Let us fight the good fight for purity and honesty in the language against the minions of laxity!