5e uses skill checks, and ability checks even more. Why not just make it a check a caster can use to get a very good educated guess about the alignment of a creature? I guess I'd make it an arcana check, but if that's not applicable it seems intelligence or wisdom would suffice.
My first thought was that it would be a tacit check by the DM, without the player knowing the result - but on further thought, maybe the DC should be the secret part. That way, the player rolls and has an idea whether they were 'on their game today' or not, but they still wouldn't know if they were 100% right or not.
I think something like that would make alignment something players can sort of guess at - really good casters being able to make better guesses.
Something like that reminds me of the "Malazan Book of the Fallen." In that, yes, there are good and evil characters, but it's pretty complex matter to really ATTACH such labels to someone. We're all complex, and alignment is constantly shifting. Determining the absolute alignment of a creature would require an examination of the creature's entiree life - the good, bad, law, and chaos it has actually created in its whole lifetime. But one can say, "This creature means only sheer chaos and evil to us right now . . . almost certainly."
This way, alignment exists, can be known, etc., but the detection process is a bit tricky.
I also think that keeps with the spirit of 5e's approach to alignment - don't put 100% stock in it, detecting it is not a given.
It's an art, not a science.
Just an idea that popped into my head. I was thinking about picking locks and how that has changed in 5e - i.e. anyone can do it, but ability, skill, and in the case of locks, tools, make all the difference. Still, the bottom line on locks remains natural ability. So much depends on the difficulty of the lock, which is not always known to the players. So in the case of alignment, I just sort of reverse that and say, yes, the alignment is there, it can be assessed, but do YOU have the relevant skills to detect THIS creature's alignment, right here and now?
This way, you could sort of make a setting in which, yes, if I had hours and hours to review the star charts for the creature, test it's blood, etc., I could most certainly tell you its alignment. Here and now . . . that's a different and trick matter involving a lot of guessing, and including the fact the creature may well be acting outside its strict alignment at present.
For example, a monster that is merely lost, confused and needs directions. He's not intending any evil RIGHT NOW, and would thus be pretty difficult for a caster to figure out its alignment. The caster may well come up wrong, thinking this creature is neutral good or something. That could change 30 seconds from now, when the monster sees some piece of treasure it covets, or decides the PCs look tasty . . .
The opposite end of the spectrum of course is a creature that's fairly SATURATED in its alignment characteristics. A devil sitting calmy on his throne, deciding the fate of the characters, for example. In cases like that, since the DC is the DM's secret, you could give the characters a "take 10" or even "take 20" to determine the devil is indeed quite Lawful Evil.
I just think you can work it out with skills, abilities, proficiency, possibly even tools - and the ever flexible DC.
I think alignment is intentionally nebulous like that in 5e. A case can be made for using alignment as a very strict magically, spiritually bound thing, and I've run campaigns like that. In those, the evil priest freak out the second the good guys enter the temple - with no wards or anything, just a simple Know Alignment, cast with the wave of a hand. It creates a world where evil and good, law and chaos 'bounce off of' each other more. They don't get taken in by the opposing side, because they always see them coming a mile away.
I'm sort of gathering that's NOT what 5e is about. It feels more to me like alignment is a deeply personal, abstract, fleeting quality, in day to day practice. It's the balance of the Planes, and where any individual soul really falls on that spectrum, well, it's not decided until that creature's life story is complete.
So yeah, bit repetitive, but I think I'll just use abilities, skills, etc.