Senegal and Uruguay were also among the five countries that garnered the required votes for council seats during a secret-ballot poll held at the UN General Assembly.
The five countries ran unopposed for the non-permanent seats after regional groups put them forward as their choice, but the contenders still had to garner two-thirds of votes cast.
Applause and cheers broke out in the assembly hall after first results showed Senegal had won the largest share, picking up 187 votes followed by Uruguay with 185.
Japan picked up 184 votes, Egypt won 179 and Ukraine 177 in the 193-nation assembly.
Ukraine's candidacy had been closely watched amid expectations that sparks will fly with permanent council member Russia, which is accused of supporting separatist rebels in the war in eastern Ukraine.
After the results were announced, Ukrainian President Petro Poroshenko posted a victorious "Yes, we did it!" on his Facebook page.
The vote "opens new possibilities for Ukraine to protect its sovereignty and territorial integrity," he wrote.
Foreign Minister Pavlo Klimkin hailed the result as "a very important day for Ukraine" and stressed that his country "understands the value of peace, struggling under Russian aggression."
Kiev's envoy "will be making the case for Ukraine, for our fight" at the council, Klimkin told reporters.
The newly-elected members will begin their two-year stint on January 1, replacing Chad, Chile, Jordan, Lithuania and Nigeria.
Signup to our newsletter and follow us on Facebook and Twitter!
- Japan eyes permanent seat -
One of the most experienced non-permanent members, Japan, will be taking its seat for the 11th time as it is locked in an island dispute with China and bristles at Beijing's global role.
Tokyo is also making a push at the United Nations for expanding the 15-member council and making Japan a permanent member, a plan fiercely opposed by China and resisted by Russia and the United States.
Japanese Ambassador Motohide Yoshikawa said Tokyo wants to make the council "stronger and also more open" and recalled that Pope Francis had spoken out in favour of Security Council reform during his UN visit last month.
Taking a tough line on North Korea, Japan is expected to raise concerns about the Pyongyang regime at the council even though China sought to block discussion about human rights when it came up in December.
Yoshikawa said he hoped that the council will "be seized" by North Korea's dismal rights record "at the appropriate moment" and decide on the how to deal with the "betterment of the human rights issue."
Egypt is returning to the council for the sixth time as Yemen, Libya, Lebanon and the Palestinian territories join Syria on the list of Middle East crisis spots.
Egyptian Foreign Minister Sameh Shoukry said his country will work "to resolve the very many issues" on the UN agenda.
The five newcomers will join the other five non-permanent council members: Angola, Malaysia, New Zealand, Spain and Venezuela.
The campaign for a seat at the top diplomatic table caps months and, in some cases, years of lobbying by contenders.
As voting got underway, delegates at the General Assembly were handed gift bags with chocolates from Ukraine, tea from Japan, pens from Senegal and a football from Uruguay.