The two survivors, including one who was badly burned, had escaped from the facility themselves in the city of Daejeon, a fire official told a briefing on Monday.
"Authorities have yet to identify the victims because their bodies were severely damaged," a health official told the same briefing.
A fire official said an explosion triggered the blaze, though the cause of the blast was still being investigated.
The blast appeared to have occurred while water was being used to clean explosive material from tools making rocket propellant, a Hanwha official told a company briefing.
"We bow our heads in apology to the victims and their bereaved families," said chief executive Officer Son Jae-il, pledging to co-operate fully with authorities to determine the cause of the accident.
The five dead included two temporary workers in their 20s and all were employed by Hanwha, the company said.
Hanwha is a defence and aerospace company. Its factory in Daejeon produces large propulsion engines and handles rocket propellants.
Authorities were unable to obtain the factory's layout since it is protected under national security laws, an official said at an earlier briefing.
South Korean President Lee Jae Myung called for the mobilisation of all available resources to respond to the accident and for an investigation, his office said in a text message to reporters.