Madhuri Gupta was found guilty in a New Delhi court on Friday of "spying and wrongful communication of information" while posted to the Indian embassy in Islamabad.
Gupta, 61, was arrested in 2010 for allegedly passing information to the spy agency.
The low-level diplomat was detained for alleged breaches of India's official secrets act and held for two years before being released on bail.
How Kulbushan Jadhav led India's covert war in Pakistan
Her lawyer, Joginder Dahiya, said Gupta would appeal her sentencing in a higher court.
"She has already been in custody for about 21 months. She should have been released on the basis of the time she has already spent in jail," he said.
Gupta avoided more serious jail time because the information she passed to Pakistani handlers in 2009 and 2010 was not military in nature, the Press Trust of India reported.
Pakistan Army shoots down Indian 'spy drone' along LoC
As a second secretary, Gupta was among the lowest ranked officials at the highly-sensitive embassy in Islamabad.
She has always denied the charges and claims she was falsely implicated by embassy and foreign ministry officials with whom she had a strained relationship.
But the court determined that her actions had tarnished India's reputation and compromised its security, handing the maximum possible jail term for the offences.
India accuses Pakistan of harassing Kulbhushan Jadhav's family
The information "passed on by the accused [was] categorically sensitive information which could have been useful to the enemy country... and its secrecy was of utmost importance," PTI reported.
"Therefore, she does not deserve any leniency in punishment."
Indian police say Gupta had been under surveillance for six months before being taken into custody in 2010.
Nuclear rivals India and Pakistan routinely accuse one another of sending spies into their countries, and it is not uncommon for either nation to expel diplomats accused of espionage.
COMMENTS (3)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ