The victims were identified as Lt. Cmdr. Kapish Munwal and Lt. Manoranjan Kumar.
The Russian-made Kilo-class submarine was on a routine training and inspection voyage when the fire broke out early Wednesday, engulfing the sailors' quarters in smoke, officials said.
Seven sailors were airlifted to the naval Ashwini Hospital in Mumbai, suffering from smoke inhalation.
The bodies of Munwal and Kumar were found by an inspection crew, which boarded the Sindhuratna after it was towed into Mumbai harbor Thursday, the Economic Times reported.
"The two officers who were earlier declared missing have been located in the [accommodation] compartment and after examination by medical officers both the officers were declared dead," a brief message from the navy said.
Navy Chief Adm. D. K. Joshi resigned Thursday, saying he had moral responsibility for the Sindhuratna accident.
"A high-level inquiry headed by a rear admiral has been constituted to establish the cause [of all submarine incidents] and to recommend steps for continuing safe operations of submarines," a statement by the Western Naval Command said.
A source told the Times of India the Sindhuratna fire may have been triggered by a short-circuit in a battery compartment.
The Economic times reported the Sindhuratna accident was the 10th involving naval warships -- and the third submarine incident -- in the past seven months.
India has 10 Kilo-class submarines constructed in Russia's shipyards from 1985-2000, officials said last year.
Many of the submarines, including the Sindhuratna and the ill-fated 2,300-ton Sindhurakshak, underwent major refits since 1997 by the Zvezdochka shipyard in Severodvinsk near Archangel on Russia's western Arctic Ocean coast.
In August 2013, explosions ripped through the Sindhurakshak's torpedo compartment while it was berthed at the Mumbai Naval Dockyard, the vessel sank and 15 sailors and three officers were killed.