We report the discovery of HN Lib b, a sub-Neptunian mass planet orbiting the nearby (d~6.25pc) M4.0 V star HN Lib detected by our CARMENES radial-velocity (RV) survey. We determined a planetary minimum mass of M_b_sini=5.46+/-0.75M_Earth_ and an orbital period of P_b_=36.116+/-0.029d, using ~5yr of CARMENES data, as well as archival RVs from HARPS and HIRES spanning more than 13yr. The flux received by the planet equals half the instellation on Earth, which places it in the middle of the conservative habitable zone (HZ) of its host star. The RV data show evidence for another planet candidate with M_[c]sini=9.7+/-1.9M_Earth and P_[c]_=113.46+/-0.20d. The long-term stability of the signal and the fact that the best model for our data is a two-planet model with an independent activity component stand as strong arguments for establishing a planetary origin. However, we cannot rule out stellar activity due to its proximity to the rotation period of HN Lib, which we measured using CARMENES activity indicators and photometric data from a ground-based multi-site campaign as well as archival data. The discovery adds HN Lib b to the shortlist of super-Earth planets in the habitable zone of M dwarfs, but HN Lib [c] probably cannot be inhabited because, if confirmed, it would most likely be an icy giant.