My partner and I have been in the same situation regarding National Insurance payments. We somehow found out when we moved in together though. We heard she could make something called a credits only claim but when we went to the job centre they told us there was no such facility only the main claimant of ESA would get NI paid. That was over ten years ago.
We need to move over to UC next week. I'd be eager to hear if you ever find a way to get NI back payments for your partner.