Stress-associated proteins (SAPs) are known to play an important role in plant responses to abiotic stresses. This study systematically identified members of the sunflower SAP gene family using sunflower genome data. The genes of the sunflower SAP gene family were analyzed using bioinformatic methods, and gene expression was assessed through fluorescence quantification (qRT-PCR) under salt and drought stress. A comprehensive analysis was also performed on the number, structure, collinearity, and phylogeny of seven Compositae species and eight other plant SAP gene families. The sunflower genome was found to have 27 SAP genes, distributed across 14 chromosomes. The evolutionary analysis revealed that the SAP family genes could be divided into three subgroups. Notably, the annuus variety exhibited amplification of the SAP gene for Group 3. Among the Compositae species, C. morifolium demonstrated the highest number of collinearity gene pairs and the closest distance on the phylogenetic tree, suggesting relative conservation in the evolutionary process. An analysis of gene structure revealed that Group 1 exhibited the most complex gene structure, while the majority of HaSAP genes in Group 2 and Group 3 lacked introns. The promoter analysis revealed the presence of cis-acting elements related to ABA, indicating their involvement in stress responses. The expression analysis indicated the potential involvement of 10 genes (HaSAP1, HaSAP3, HaSAP8, HaSAP10, HaSAP15, HaSAP16, HaSAP21, HaSAP22, HaSAP23, and HaSAP26) in sunflower salt tolerance. The expression of these 10 genes were then examined under salt and drought stress using qRT-PCR, and the tissue-specific expression patterns of these 10 genes were also analyzed. HaSAP1, HaSAP21, and HaSAP23 exhibited consistent expression patterns under both salt and drought stress, indicating these genes play a role in both salt tolerance and drought resistance in sunflower. The findings of this study highlight the significant contribution of the SAP gene family to salt tolerance and drought resistance in sunflower.