Sesquiterpenes are a type of abundant natural product with widespread applications in several industries. They are biosynthesized by sesquiterpene synthases (STSs). As valuable and abundant biological resources, mushroom-forming fungi are rich in new sesquiterpenes and STSs, which remain largely unexploited. In the present study, we collected information on 172 STSs from mushroom-forming fungi with experimentally characterized products from the literature and sorted them to develop a dataset. Furthermore, we analyzed and discussed the phylogenetic tree, catalytic products, and conserved motifs of STSs. Phylogenetic analysis revealed that the STSs were clustered into four clades. Furthermore, their cyclization reaction mechanism was divided into four corresponding categories. This database was used to predict 12 putative STS genes from the edible fungi Flammulina velutipes. Finally, three FvSTSs were selected to experimentally characterize their functions. FvSTS03 predominantly produced Δ-cadinol and FvSTS08 synthesized β-barbatene as the main product; these findings were consistent with those of the functional prediction analysis. A product titer of 78.8 mg/L β-barbatene was achieved in Saccharomyces cerevisiae via metabolic engineering. Our study findings will help screen or design STSs from fungi with specific product profiles as functional elements for applications in synthetic biology.