The Z3-invariant next-to-minimal supersymmetric standard model (NMSSM) can provide a candidate for dark matter (DM). It can also be used to explain the hypothesis that the Higgs signal observed on the Large Hadron Collider (LHC) comes from the contribution of the two lightest CP-even Higgs bosons, whose masses are near 125 GeV. At present, XENON1T, LUX, and PandaX experiments have imposed very strict restrictions on direct collision cross sections of dark matter. In this paper, we consider a scenario that the observed Higgs signal is the superposition of two mass-degenerate Higgs in the Z3-invariant NMSSM and scan the seven-dimension parameter space composing of λ,κ,tanβ,μ,Ak,At,M1 via the Markov chain Monte Carlo (MCMC) method. We find that the DM relic density, as well as the LHC searches for sparticles, especially the DM direct detections, has provided a strong limit on the parameter space. The allowed parameter space is featured by a relatively small μ≤300 GeV and about tanβ∈(10,20). In addition, the DM is Higgsino-dominated because of |2κλ|>1. Moreover, the co-annihilation between χ˜10 and χ˜1± must be taken into account to obtain the reasonable DM relic density.