We had lived there for nearly the last five years
It just...well maybe it could be 'we have lived here for the last five years' or 'we have lived here for almost five years now'. Maybe, it's up to you.
We had lived there for nearly the last five years