That depends. Is it the only thing you have to ask them, or is there an extended conversation involved?
If you're talking about a bunch of things I could see slipping that in no problem. Especially if they introduce themselves.
If I had to force it into a very short interaction, I would probably ask how their day is going (which is standard small talk) and then ask your question as if it's your reaction to what they said. That way it seems like they prompted the question and not like you came in to ask it.