The audacious raid, in which the two attackers died, came a day after six people were killed and 46 wounded in grenade blasts near one of the holiest shrines for Hindus.
The fighters stormed the army camp in India-controlled Kashmir at Akhonor which is the winter capital for Jammu and Kashmir.
They threw grenades on the camp and sprayed automatic weapons fire after disguising themselves as Indian soldiers by wearing similar army uniforms, an army officer said.
“We have killed both the militants who attacked the camp and on our side the casualty toll is seven soldiers dead and six soldiers wounded,” the defence official said.
Jammu and Kashmir Chief Minister, Mufti Mohammed Syed, blamed the suspected Islamist fighters for the flare-up of violence.
India and Pakistan were close to war last year after India accused Pakistan of being behind an attack on the Indian parliament.
Relations improved in the past few months after Indian Prime Minister, Atal Behari Vajpayee, said he wanted to make a new push for peace.
No group has claimed responsibility for Monday’s attack on pilgrims in Katra, which is the point where people gather to walk to the Vaishno Devi mountain shrine.
The site is located 45 km from Jammu and draws around 15,000 people daily.
The fighters hurled homemade bombs and grenades at a public kitchen where pilgrims were dining, police said.
One woman died from her injuries overnight in hospital, raising the number to six, a police official said.
The 46 injured include 16 women and nine children, he added.
India says that Pakistan was inciting violence in Kashmir.
But Islamabad denies the accusations, saying it only provides moral support to the fighters which it considers are engaged in a legitimate freedom struggle.