The Rebellion regularly used the phrase "May the Force be With You" as a type of blessing or honorific. The Force exists in the Star Wars Universe, and many people know what it is and believe in it. Even if at some point in history it became legendary, it was still a major part of galactic culture. In more modern canon, we've actually seen people who worship the Force who are not Force Sensitive at all, such as Chirrut Îmwe or Lor San Tekka of the Church of the Force. Or even the Sith Eternal who were not Force Users, but worshipped the Dark Side of the Force all the same.
So Din catching on to how to use the phrase at some point, or simply just being familiar with the phrase without fully knowing it's meaning, is entirely likely.