What I think is rather simple. The tricorder did all the work: It registered the spy as a Klingon. Anyone who knew how to use a tricorder could reach the conclusion McCoy did.
I'm afraid it's even easier than that. As soon as the tricorder showed readings all wrong for a human, only the most cursory knowledge of Klingon anatomy would be necessary to identify him as Klingon. A person can "know" where a human heart and lungs are, where the liver, kidney and speen are and what they do without truly knowing
the anatomy, surely not enough to save a critically perforated patient who has lost a lot blood and is probably in shock. Thus McCoy can "know" the anatomy without really knowing
And don't get me started on the biblical sense...