The emergence and spread of avian influenza viruses across diverse host species, exemplified by highly pathogenic clade 2.3.4.4b H5N1 viruses, depend in part on the functional compatibility between the surface glycoproteins hemagglutinin (HA) and neuraminidase (NA). However, the molecular determinants governing preferential HA-NA pairing remain unclear. Here, we show that clade 2.3.4.4b H5 HA with six glycosylation sites preferentially pairs with the full-length (long-stalk) N1 NA in birds and mammals. By contrast, H5 HA proteins from earlier clades with seven glycosylation sites preferentially pair with N1 NA proteins characterized by a stalk deletion (short-stalk). Our results indicate that the HA S/T160A mutation, observed in avian influenza viruses, abolishes the N158 glycosylation site and favors pairing with long-stalk N1, improving molecular compatibility and enhancing viral fitness. The N158 glycan underlies the preferential pairing of Gs/GD-lineage H5 viruses with short-stalk N1 proteins. These findings suggest that HA-NA pairing in avian influenza viruses is not an entirely stochastic process but is constrained by HA glycosylation status and NA stalk length, with implications for viral fitness and the emergence of clade 2.3.4.4b H5N1 viruses.