Confirming the Identity of a (Friendly) Reviewer After the Reviews
No, this is why the review process is anonymous...
Any "reaching out", while you say it is only to find out if they did or did not review your paper (and others will think "well that's because they want an inside track"...) will put the reviewer in a difficult position whether you intend that or not.
The reviewer's reputation with the journals they work with is important to them, so while you might be curious, don't go there.
There is one reason I can think of as legitimate for getting the identity of a reviewer, and it is closely related to your situation: you have a manuscript rejected and found the reviewer's comments so helpful that you'd like to ask them to collaborate and become co-author of the enhanced version of the manuscript.
In contrast,
In my reaching out to this reviewer, it would be solely to ask whether or not they reviewed the paper, and not discuss the review whatsoever (regardless of how they responded).
to me would not be a legitimate reason.
All that being said, I still don't think it legitimate if an author directly approaches the suspected reviewer: what you could do is to explain your reason for wanting to contact the reviewer to the editor who handled your manuscript. If they think it a legitimiate reason, they can contact the reviewer whether they in turn agree to be de-anonymized. If everyone agrees, you'll get to know your reviewer - if not, this procedure ensures their anonymity.
Is it ever appropriate to ask such a question, and if so, when?
I can't think of many instances (probably only if there's some gross misconduct). Reviewers are anonymous for a good reason.
Out of sheer curiosity, I'd like to reach out to this individual to ask if they were a reviewer for this paper.
Paraphrasing, curiosity killed the paper :)
How about just sending them a copy of the manuscript and asking for their opinion?
"I have written a manuscript that I think you might find interesting, I would love to hear your thoughts."
This alludes in no way to you having any suspicions (you may get your answer if they inadvertently let it slip), and offers you a chance to get more feedback. If they aren't actually the reviewer then you can get more feedback and outreach for your work - a happy unintended consequence!