Additional Sessions Judge Sidharth Sharma gave her the maximum sentence for the offences of spying and wrongful communication of information protected under the law.
Ms Gupta, who was the Second Secretary (Press & Information) at the high commission, was held guilty yesterday under various provisions of the Official Secrets (OS) Act.
She has been granted bail by the court to allow to appeal against the conviction and the sentence.
Ms Gupta was convicted under Sections 3 and 5 of the Official Secrets Act which attract a maximum sentence of three years and fine or both.
She was arrested on April 22, 2010 by the special cell of the Delhi Police for allegedly passing on sensitive information to Pakistani officials and remaining in touch with two ISI officials, Mubshar Raza Rana and Jamshed.
Election Results for Lok Sabha Election 2019 will be out on May 23. Get the latest election news and live updates on ndtv.com/elections. Catch all the action on NDTV Live. Like us on Facebook or follow us on Twitter and Instagram for news updates from each of the 543 parliamentary seats for the election 2019