Germany received 184 votes, Belgium had 181, South Africa got 183, and the Dominican Republic had 184 after one round of voting.
The Council’s ten non-permanent seats, are allocated according to a rotation pattern set by the Assembly in 1963, to ensure fair regional representation on the Council: five from African and Asian and Pacific States; one from Eastern Europe; two from Latin American States; and two from Western European and Other States (WEOG).
The five seats not up for election this year are currently held by Ivory Coast, Equatorial Guinea, Kuwait, Peru and Poland.
Indonesia scores a decisive victory
Under the UN Charter, the Security Council has the primary responsibility for international peace and security, with all UN Member States required to comply with Council decisions.
The council is the only UN body that can make legally binding decisions and has the power to impose sanctions and authorise the use of force.
Indonesia drew more votes than the Maldives in the contested election for one Asia-Pacific seat by 144 to 46, while the other four candidates ran unopposed.
German Foreign Minister Heiko Maas -- who was present for the vote -- said his country wanted to be a "strong voice for peace in the Security Council."
"But above all, we want a multilateral world order for the future, based on the rules that we have worked on tirelessly for decades, especially here at the United Nations," Maas added.
The Belgian government said it was joining the council at a "pivotal moment."
"It's a period when multilateralism no longer seems obvious to all, with some even questioning it, even as the planet is confronted with multiple global challenges, including climate change, the (UN) Sustainable Development Goals, the fight against terrorism and illegal migration," it said.
South African President Cyril Ramaphosa said his country was "humbled and honored by the confidence the international community has demonstrated in our capability to contribute to the resolution of global challenges."
He also expressed concerns about "the emergence of unilateralism and its attendant threat to the international rules-based system."
There are 15 members on the UN Security Council, including the five permanent ones -- Britain, China, France, Russia and the United States -- and 10 non-permanent members, half of which are elected each year.
Each candidate country needed to secure two thirds of the votes in order to clinch a seat.
The Dominican Republic will take its first turn on the Security Council, while the other nations chosen have served before.
Belgium and Germany obtained the two seats for the Western Europe and Others Group after Israel dropped out of the competition.
The Maldives, with only 46 votes, lost out to Indonesia for the Asia Pacific regional group's seat.
The African Union made a deal to see that South Africa was elected, while the Dominican Republic took up Latin America's spot after a similar consensus in that regional group.
The five new members will replace Bolivia, Ethiopia, Kazakhstan, the Netherlands and Sweden on the council.
Just before taking up their duties, the elected states get intense training about Security Council protocol and customs.
The ambassadors will each preside over the council for a month during their mandate.
Elaborate nomination process
Each regional bloc has its own process for Security Council candidates. For some, "it's first come, first served," and countries often seek a seat very early on, a diplomat said, speaking on condition of anonymity.
"You can put forward your candidacy for 10 years," the diplomat added, though others can challenge that spot.
For the current election, "Israel in the end decided to withdraw because it understood it stood no chance and could face humiliation with 30, 40 or even 50 votes maximum," which would trigger its automatic elimination, the diplomat explained.
In the Western Europe group, there is no agreement on who can get a spot. "As soon as it leaves the council after a term, Germany systematically puts forward its candidacy for six or seven years later," the diplomat said.
So before seeking a seat, a country looks at the competitors already listed.
The diplomat noted that the Africa group has a "very sophisticated" process in order to always have three seats at the council, including one Arab country.