The deal has been a constant source of tension between the two countries, with Pakistan arguing that it is vital to its ability to cope with an energy crisis and the US stressing that it would undercut international economic pressure on Iran over its nuclear programme.
Gilani said Pakistan would reconsider the deal if it violated UN sanctions, but the country was "not bound to follow" unilateral US measures.
The UN has levied four sets of sanctions against Iran for failing to suspend uranium enrichment, a process that can produce fuel for a nuclear weapon. The latest set of UN sanctions was approved earlier this month.
The US has also applied a number of unilateral sanctions against Iran, and Congress is currently finalising a new set of measures largely aimed at the country's petroleum industry.
The new US sanctions target insurance companies, oil firms and shipping lines linked to Iran's nuclear or missile programmes as well as the regime’s Islamic Revolutionary Guards Corps or Pasdarans.
Pakistan and Iran conclude the gas deal earlier this month. Under the contract, Iran will export 760 million cubic feet of gas per day to Pakistan through a new pipeline beginning in 2014.
The construction of the pipeline is estimated to cost some US$ 7 billion.