The women, backed by an influential hardline Hindu group linked to Modi's party, said they were determined to secure the legal right for Hindus to pray daily to the idol of a goddess and relics that they say are inside a prominent mosque in Varanasi.
Varanasi is one of Hinduism's holiest cities, and it is also where the Gyanvapi mosque is located - a common phenomenon across India after the Mughal conquest of the region during the 16th and 17th centuries.
Disputes between religious communities over such sites have flared up ever since independence in 1947, but they have become more common in recent years. Muslims make up around 13% of India's 1.35 billion people.
Hindu groups have submitted several cases to local courts over disputed sites in parts of India in the last few weeks. Some Muslims see this as part of an attempt to marginalise them with the tacit blessing of Modi's ruling Hindu nationalist Bharatiya Janata Party (BJP).
The BJP denies stoking religious tensions, and says it is a party that promotes progress for all Indians.
In Varanasi, an ancient city on the River Ganges that is dotted with thousands of temples, one of the Hindu petitioners is Manju Vyas, who runs a beauty salon.
She and four friends approached the court last year to declare the Gyanvapi mosque "an illegal structure built by Islamic rulers after demolishing parts of a temple in the 1600s".
A pre-existing legal order has allowed hundreds of Hindu women to symbolically worship the goddess Sringar Gauri once a year from the doorstep of the mosque.
But last year Vyas said some Muslim men insulted them as they stood near the mosque to pray, a charge the cleric of the mosque rejected.
"Everyone, even the Muslims in Varanasi, are aware that a temple stood before the mosque and now because of our case the court has ... video clips that show Hindu remnants lay scattered inside," said Vyas, 46.
The judge hearing the plea this month permitted a survey of the mosque to verify those claims. Reuters reviewed the report prepared by the survey team this week.
"Hindu religious idols, relics of God Shiva and symbols were found inside a water tank and the basement of the Gyanvapi mosque," according to the report.
Muslims attached to the Gyanvapi mosque said the court-appointed surveyors had mistaken a fountainhead in the water tank as a Hindu idol and motifs were flowers embedded in Persian design.
The Supreme Court has allowed the survey to stand as evidence and for proceedings to continue.
"We will legally liberate our goddess from the clutches of Islam," said Sohan Lal, husband of one of the five women petitioners and a senior member of the Vishva Hindu Parishad (VHP), the World Hindu Council.
Three decades ago it was the VHP that succeeded in getting a temple built at the site of a disputed 16th century mosque in the town of Ayodhya after it was demolished by Hindu crowds who said it had been built where Hinduism's Lord Ram was born.
The incident in 1992 led to religious riots that killed nearly 2,000 people, mostly Muslims, across India and helped propel the BJP to prominence.
Top leaders of the BJP and some nationalist historians believe Muslim leaders, during their 200-year rule, destroyed prominent Hindu temples to build mosques or mausoleums as part of an expansionist strategy.
A senior BJP leader in New Delhi, who spoke on condition of anonymity because the matter is in court, said the time was right to reclaim Hindu heritage and that the challenge was to do so without sparking religious violence.
"The era of historic revisionism has begun," he said.
Asaduddin Owaisi, the leader of a regional Muslim party and a federal lawmaker, said the aim of the Gyanvapi mosque controversy is to "create a landscape of hate and animosity in the country.
"The government is always digging up the past to divert everyone from relevant issues such as price rise, unemployment and weak infrastructure," he said.
Some Islamic scholars and secular Hindus want Modi, whose parliamentary constituency is Varanasi, to urge litigants to withdraw legal cases fought over the ownership of religious sites in Varanasi and elsewhere.
"Modi has to stand up and say 'let bygones be bygones', but that would hurt his loyal Hindu vote base," said Dhirendra Sharma, a political science professor in Varanasi.
Modi's office did not immediately respond to a request for comment.