What spell permits the caster to take on the alignment of a nearby person or object?

A Good character wants to infiltrate the headquarters of an Evil organization using a disguise. Said organization will cast Detect Good on all newcomers once upon entry. The character wants to pass that exam because Strategy (not avoid it).

Undetectable Alignment will raise eyebrows at the entry gate. "Everyone else submits to the scan. What have you got to hide, newcomer?" Nondetection will raise alarm bells for the same reason. Perhaps he could bluff his way past, but the objective here is to satisfy the test and get accepted by the gatekeepers.

I thought there was a Pathfinder spell which allowed the caster to pick something in close range, like nearby Chaotic Evil NPC Who Just Kicked A Puppy, and register as the alignment of that NPC: CE. Or you carry an unholy LE object in your backpack; under the spell, you register as Lawful Evil. Or you could pick up a pebble, cast the spell with the target as the pebble, and register as Neutral.

I have not found that in my Pathfinder 1e books so far.