A search for a very light Higgs boson decaying into a pair of leptons is presented within the framework of the next-to-minimal supersymmetric standard model. This search is based on a data set corresponding to an integrated luminosity of 19.7 fb of proton-proton collisions collected by the CMS experiment at a centre-of-mass energy of 8 TeV. The signal is defined by the production of either of the two lightest scalars, or , via gluon-gluon fusion and subsequent decay into a pair of the lightest Higgs bosons, or . The or boson is identified with the observed state at a mass of 125 GeV. The analysis searches for decays of the states into pairs of leptons and covers a mass range for the boson of 4 to 8 GeV. The search reveals no significant excess in data above standard model background expectations, and an upper limit is set on the signal production cross section times branching fraction as a function of the boson mass. The 95% confidence level limit ranges from 4.5 pb at 8 GeV to 10.3 pb at 5 GeV.