Whereas the separation by surface affinity represents an advanced technique for the separation of nanoparticles with distinct surface properties, how the interaction of particles with nanochannel impacts the separation performance is less understood. Herein, the dynamical density functional theory is employed to study the separation of two types of similar-sized particles with different surface affinities within nanochannels.We show that a proper design of the channel inner-surface, which attracts one type of particles while repelling the other, can promote the permeability and selectivity of particles. Meanwhile, the trade-off relations between permeability and selectivity are found and analyzed in nanochannels of different sizes. Based on dynamical density functional theory calculations, an extended model relating permeability to the equilibrium partition coefficient is proposed to analyze the permeability and selectivity, which displays good predictions of the transport of charged particles in comparison with experimental results. This work provides helpful insights for designing an efficient affinity-based separation of nanoparticles process through nanochannels.