Sex is a biological concept and is determined by science.
Gender is originally a literary term.
One of your mates trying to prove they were the same linked to this and just proved himself wrong
x, [2], 1064 p. 19 cm
archive.org
ge'nder • (j-), n. Grammatical classification (or one of the two, or three, classes) of objects roughly corresponding to the two sexes & sex- lessness (masculine, feminine, & neuter; see also common *, epicene), (of nouns & pro- nouns) property of belonging to such class, (of adjj.) appropriate form for accompanying a noun of any such class; (joe) sex. Hence ge'ndePLESS a. [f. OF gen(d)re f. L genus]