Mr Gilani is set to be charged on 13 February with failing to reopen corruption cases against President Asif Ali Zardari.
The prime minister, who appeared before the court last month, faces jail and being barred from office if convicted.
Mr Gilani argues that the president – who denies the corruption charges – has immunity as head of state.
Analysts say the rejection of the appeal will prolong a stand-off between the government and the judiciary, which many believe is being backed by the military as it pursues the case against the civilian administration.
Eight of the court’s judges, headed by Chief Justice Iftikhar Chaudhry, heard the appeal.
They upheld an earlier order which called upon the government to write to the Swiss authorities to ask them to reopen corruption proceedings against Mr Zardari.
“The order is found to be strictly in accordance with the law and principles of criminal administration of justice and therefore no interference is called for,” the ruling said.
Mr Gilani’s lawyer, Aitzaz Ahsan, said the prime minister would now appear before the court on 13 February, when he will be formally indicted.