Hazrat Moulana Ashraf Ali Thaanwi (rahimahullah) once mentioned the following:
According to the Sufis, the term “Nisbat (connection)” refers to acquiring a special connection with Allah Ta‘ala and this special connection is a sign of one being a wali of Allah Ta‘ala (a special friend of Allah Ta‘ala).
The way to acquire this nisbat can be summed up in two sentences: (1) Through constantly remaining in the obedience of Allah Ta‘ala (2) Through constantly remaining in the remembrance of Allah Ta‘ala. In other words, that person is regarded as a Saahib-e-Nisbat (a special friend of Allah Ta‘ala) who at all times adheres to the commands of Shariah, refrains from all types of sins and constantly remains in Zikr (the remembrance of Allah Ta‘ala).
Hazrat Thaanwi (rahimahullah) was then asked whether this Nisbat is acquired through the grace of Allah Ta’ala or through one’s effort and actions. Hazrat Thaanwi (rahimahullah) replied that gaining this Nisbat takes place solely through the grace of Allah Ta‘ala and not through one’s effort and actions. However, when one remains constant in adhering to the commands of Shariah and fulfils what Allah Ta‘ala wants from him at all times, then Allah Ta‘ala blesses him with Nisbat.
(Malfoozaat Hakeemul Ummat 24/203)