Effective pulp-capping materials should possess properties to induce the formation of reparative dentin to preserve vital dental pulp. However, many current biomaterials ignore the anti-inflammatory effect during pulp capping treatment. In this study, dexamethasone (DEX) was used as an anti-inflammatory and osteogenic drug, and was encapsulated by mesoporous silica-loaded nanohydroxyapatite (na-HAp) to form MSN@na-HAp-DEX. The characteristics of MSN@na-HAp-DEX, its effects on human dental pulp stem cells (hDPSCs) viability, anti-inflammatory, differentiation induction were examined. MSN@na-HAp-DEX presented a typical core–shell structure with a nanosize and a large specific surface area and was successfully loaded with DEX. The hDPSCs exposed to MSN@na-HAp-DEX showed good cell viability at three days and stronger ALP activity with more calcium deposition in vitro. In addition, the expression of odontogenesis-related genes exposed to MSN@na-HAp-DEX were significantly upregulated and the expression of inflammatory genes were significantly downregulated in vitro. Meanwhile, MSN@na-HAp-DEX showed good cytocompatibility and induced mineralized tissue to preserve the dental pulp in a direct pulp-capping model in rat. This novel direct pulp capping nanomaterial loading DEX is expected to an alternative for conventional materials.