Candidates in a headhunter or a recruiter's database that are not actively looking to switch jobs are called passive candidates. Such candidates are generally sourced by headhunters who have a pre-existing relationship with them or because they possess a specific skill and are infrequently available.
The right way to reach out to passive candidates is different from that of active candidates. Cold calls or cold recruiting emails with a pitch to interview for new positions almost never work. What you need to do is research the candidate and first build a relationship with them.
Pro tip: Passive candidates can be tracked from their updates on social media about their work. Look for people that have been in the same position for over 2-3 years.