Membrane proteins, comprising over one-third of all human proteins, are essential to numerous biological functions and serve as critical targets for medical research. Despite advancements in AI technology, designing ligands de novo to target membrane proteins remains a challenge. Nanobodies offer a promising solution, as they can be tailored through the immunization of camelids with the target antigen. However, the inherent complexity of membrane proteins often prevents their effective use as immunogens, complicating the development of nanobodies that specifically bind these targets. To overcome this hurdle, we have developed an epitope-stabilizing strategy. Central to this approach is the identification and stabilization of a suitable epitope fragment from the target membrane protein. Applying this strategy, we successfully identified and stabilized an epitope fragment from voltage-gated sodium channel 1.7 (NaV1.7), a potential pain target. Immunization of alpacas with the stabilized fragment resulted in several nanobodies exhibiting nanomolar affinity. Through a combined screening approach using NMR and AlphaFold, we identified a nanobody capable of selectively binding the integral NaV1.7, with binding validated by immunofluorescence experiments. This methodology offers valuable insights into the discovery of nanobodies targeting complex membrane proteins.