Drought is the main environmental factor that limits the yield and quality of apples (Malus × domestica) grown in arid and semi-arid regions. Nuclear factor Ys (NF-Ys) are important transcription factors involved in the regulation of plant growth, development, and various stress responses. However, the function of NF-Y genes is poorly understood in apples. Here, we identified 43 NF-Y genes in the genome of apples and conducted an initial functional characterization of the apple NF-Y. Expression analysis of NF-Y members in M. sieversii revealed that a large number of NF-Ys were highly expressed in the roots compared with the leaves, and a large proportion of NF-Y genes responded to drought treatment. Furthermore, heterologous expression of MsNF-YB21, which was significantly upregulated by drought, led to a longer root length and, thus, conferred improved osmotic and salt tolerance in Arabidopsis. Moreover, the physiological analysis of MsNF-YB21 overexpression revealed enhanced antioxidant systems, including antioxidant enzymes and compatible solutes. In addition, genes encoding catalase (AtCAT2, AtCAT3), superoxide dismutase (AtFSD1, AtFSD3, AtCSD1), and peroxidase (AtPER12, AtPER42, AtPER47, AtPER51) showed upregulated expression in the MsNF-YB21 overexpression lines. These results for the MsNF-Y gene family provide useful information for future studies on NF-Ys in apples, and the functional analysis of MsNF-YB21 supports it as a potential target in the improvement of apple drought tolerance via biotechnological strategies.