If you don't see the person that often – introduce yourself. Then let them know you've heard of their loss. They might worry that they have to break the news to YOU.
Say something like: "The minister told me about your daughter dying and I’m so sorry." Now let them know you care by stating something like "I've been thinking of you."
If this causes tears to flow, resist blaming yourself that you have caused the pain – you have just given them company in their grief which will mean a great deal.