Guy-Bertrand Mapangou, spokesman for the government, announced the deaths and arrests on Monday after soldiers briefly seized the radio station and broadcast a message saying Bongo was no longer fit for office.
The 59-year-old president, who suffered a stroke in Saudi Arabia in October, has been in Morocco for medical treatment since November.
On December 31, in one of his first television appearances since the stroke, Bongo, slurred his speech and he appeared unable to move his right arm. It is unclear if he is able to walk.
In a radio message at 4:30 am (0330 GMT), Lieutenant Kelly Ondo Obiang, who described himself as an officer in the Republican Guard, said Bongo's New Year's Eve address "reinforced doubts about the president's ability to continue to carry out of the responsibilities of his office".
A video posted on social media shows Ondo wearing military fatigues and a green beret as he reads the statement. Two other soldiers with rifles stand behind him.
Ondo said the coup attempt was by a group called the Patriotic Movement of the Defence and Security Forces of Gabon, who wanted to "restore democracy" in the oil-rich West African nation.
Outside the radio station, about 300 people gathered in support of the coup attempt, but were quickly dispersed by loyalist soldiers.
Later, security forces stormed RTG state broadcasting headquarters, capturing the rebel chief, killing two of his team and freeing journalists and technicians who had been held hostage and forced to help the mutineers make their broadcast, the presidency said in a statement.
"The situation is under control," the statement said.