Actually it nearly works all the time. The caveat, however, is that the guard seems to need to be within a certain distance. If you try to ask a guard on the opposite side of the zone, he/she may respond that they don't know.
Also try just the first name or just the last name. If the guard recognizes the name, they'll tell you the full name so you can double-check that they're pointing you at the right NPC.
(Some zones have multiple NPCs who share a last name...)