If the aim in offering condolences is to make them think favourably of Islam, then that is permissible and this is one of the aims of sharee’ah. The same applies if doing so will ward off their harm from him or from the Muslims, because a small infraction may be overlooked is that may serve the general interests of Islam.
And Allaah is the source of strength. May Allaah send blessings and peace upon our Prophet Muhammad and his family and Companions. End quote.