For most people indirectly, but yes. Whether you feel "male" or "female" is a core aspect of gender, and "being male" means having XY chromosomes, while "being female" means having XX. Physical sex organs & hormone production also tend to play into gender but aren't necessarily as fundamental: women don't stop being female after they go through menopause or have a hysterectomy. But females can feel that they should have been born male (and likewise the reverse), and can undergo hormone replacement, gender reassignment surgery, and act to comply with the societal norms for men. They'd still be female, but they'd be men. Man & woman are genders, male & female are sexes.
Of course for the vast majority of people their gender matches their sex. And it matches the sex hormones they produce, their sex organs, etc. We don't directly perceive our chromosomes, but we do perceive their effects, and those effects usually align with our gender.
Of course for the vast majority of people their gender matches their sex. And it matches the sex hormones they produce, their sex organs, etc. We don't directly perceive our chromosomes, but we do perceive their effects, and those effects usually align with our gender.