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.
Follow NDTV for latest election news and live coverage of assembly elections 2019 in Maharashtra and Haryana.
Subscribe to our YouTube channel, like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.