Archbishop Thabo Makgoba visited Mr Mandela, 94, in hospital in Pretoria, praying with his wife Graca Machel.
Elders from Mr Mandela's Tembu clan are due to visit Mr Mandela on Wednesday, local media say.
Mr Mandela's condition became critical on Sunday, following his admission on 8 June with a recurring lung infection.
The scene at the hospital, where well-wishers have decorated a wall with flowers and supportive messages, is described as quiet, save for waiting journalists.
It is Mr Mandela's third stay in hospital this year with lung problems.
Mr Mandela, known by his clan name Madiba, is revered for leading the fight against white minority rule in South Africa and then preaching reconciliation despite being imprisoned for 27 years. He left power after five years as the country's first black president.
Cape Town Archbishop Makgoba's prayer, delivered during a visit to the private hospital late on Tuesday, seemed to echo the growing feeling in South Africa that Mr Mandela is reaching the end of his life, correspondents say.
"May [we] be filled with gratitude for all the good that he has done for us and for our nation, and may [we] honour his legacy through our lives..." reads the prayer, which was posted on Archbishop Makgoba's Facebook page.
"Grant Madiba eternal healing and relief from pain and suffering. Grant him, we pray, a quiet night and a peaceful, perfect, end."
Meanwhile, a friend of Mr Mandela and the leader of the opposition United Democratic Movement (UDM) party, Bantu Holomisa, denied that a row had broken out in the ex-president's family over funeral arrangements.
Mr Holomisa, along with Mr Mandela's children, grandchildren, traditional leaders and government ministers, met on Tuesday in Qunu, the village where Mr Mandela grew up and spent of his time after he stepped down as president in 1999, South Africa's Star newspaper reports.
"The purpose of the meeting was to brief the elders about Mandela's condition.... One does not want to leave the elders behind," Mr Holomisa told the local Mail and Guardian newspaper.
The Star reports that it has learned from three sources that Mr Mandela's grandson and his traditional heir, Mandla, wants the former president to be buried in the nearby village of Mvezo where he was born.
However, other family members want the burial to take place in Qunu and they also want the bodies of three of Mr Mandela's children, including his eldest son, Makgatho, who died of an Aids-related illness in 2005, to be exhumed from Mvezo and moved back to Qunu, the paper reports.
According to South Africa's Times newspaper, clan elders are due to travel to Pretoria on Wednesday to visit Mr Mandela.
The former South African president has children from his two previous wives, Evelyn Mase and Winnie Madikizela-Mandela, both of whom he divorced.
He retired from public life in 2004 and has rarely been seen at official events since.
He has a long history of lung problems, and was diagnosed with tuberculosis in the 1980s while he was a prisoner on Robben Island.
After his release, Mr Mandela said that the tuberculosis was probably caused by dampness in his prison cell.