Modi and Harper, who arrived from Toronto, went straight to the Gurdwara. They participated in the prayer meeting and were presented 'saropas'.
Addressing the gathering there, Modi said the Sikhs in Canada had won respect for India through their work here.
He talked about the teachings of Guru Nanak and the role of Sikhs in India's Independence struggle, including that of Bhagat Singh.
He emphasised the need for working for humanity as he highlighted how Sikhs had set examples in giving sacrifices.
More From This Section
He talked about the need for working for humanity through Hinduism.
"The Supreme Court in India has given a nice definition to 'Hindu dharam'...The Supreme Court has said that Hindu dharam is not a religion but a way of life...I believe the SC's definition shows the way," Modi said.
He said Hindu religion has worked for the benefit of nature, including wildlife, through the scientific way of life.
"This can show a way out of small problems of life," he said.
He asked Indian diaspora to spread the message about yoga for the benefit of humanity.
He highlighted the role of Indian-origin Canadians in developing bilateral relations at both the religious places.