Afghan President Hamid Karzai said this week he had renewed overtures to the insurgents, confirming in a US television interview that his government had been holding talks with the Taliban "for quite some time".
But Gilani told reporters in Pakistan's northwestern city of Charsadda that Pakistan had an essential role to play if there was to be any prospect of peace.
"Nothing will happen without us, because we are a part of the solution, we are not a part of the problem," Gilani said.
On Sunday, former Afghan president Burhanuddin Rabbani was elected chairman of a new peace council set up to broker an end to the war with the Taliban.
Backed by Karzai, the High Peace Council intends to open a dialogue with insurgents who have been trying to bring down his government since the US-led invasion overthrew their regime in late 2001.
Gilani refused to be drawn on whether Pakistan backed the plan.
"When Karzai shares his roadmap with America and they share the roadmap with us, then we will be in a position to comment on it."
Last week the Washington Post said secret talks were believed to involve the Afghan government and representatives authorised by the Quetta Shura, the Afghan Taliban group based in Pakistan, and Taliban leader Mullah Omar.
The Taliban, which have been fighting an increasingly violent insurgency, have said publicly they will not enter into dialogue with the government until all 152,000 foreign troops based in the country leave.
Pakistan was the chief supporter of the Taliban regime, which imposed a harsh brand of Islam on Afghanistan from 1996 until its ouster in a US-led military operation after the September 11, 2001 attacks.
Afghan and Western officials have long suspected that elements of the Pakistani establishment, notably the powerful Inter-Services Intelligence (ISI) agency, offer support to Afghan Taliban.
Pakistan has always rejected the accusations, saying it is committed to fighting the Taliban and is actively targetting militants.
COMMENTS (1)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ