They revelled in the divine musical atmosphere created by the qawwals.
Singer Mohit Chauhan, who is the voice of Jordan, Ranbir's character in the musical film, also accompanied the duo, along with producer Hiren Gandhi of Shree Ashtavinayak Cine Vision Ltd.
In keeping with tradition, all of them had their heads covered and paid their respects Monday night by offering a 'chaadar' at the adjoining tomb of Amir Khusrau, 13th century Sufi poet-musician who is known as the founder of qawaali, khayal and tarana music.
After that, they joined the qawwals at the Nizamuddin dargah to celebrate the conclusion of the four-day annual urs of Amir Khusrau.
Ranbir and Mohit also performed on "Kun faaya kun", a qawwali from "Rockstar".
Ranbir, who was dressed in a cream kurta teamed with a pair of jeans, played the guitar himself, while Mohit of "Masakalli" fame rendered the soulful number. What followed was an hour-long qawwali session.
The dargah holds a special place for the "Rockstar" team. Ali frequented it during the shooting of the film and Ranbir too stayed in the vicinity of the dargah for a couple of days while shooting for the qawwali scene in the film.
Oscar-winning composer A.R. Rahman, who is behind the melodies of "Rockstar", has also often expressed his reverence for the place.
"Rockstar", also featuring Nargis Fakhri, is about a young super-successful musician, and his tryst with love. The film releases Oct 11.