There isn't any real way to show only nameplates for NPCs. The game classifies nameplates as either belonging to a hostile unit, or belonging to a friendly unit. An addon could make player nameplates invisible, but they would still be there, and they would still intercept the mouse.
If you're asking because you have trouble clicking on NPCs with a bunch of players standing on top of them, a better solution is to target the NPC using a chat command:
/target Name Of The NPC
... and then bind a key to the "Interact with Target" function in the Blizzard Key Binding UI, and use that to interact with the target instead of trying to click it.
This also has the advantage of making it impossible to accidentally right-click a hostile player and attack them when you meant to interact with the NPC they were standing on top of.