"Game of Thrones" star Gwendoline Christie will also appear in "Star Wars: Episode VII," which began filming last month and is due for release in December next year, they said.
Nyong'o, who won the best supporting actress Academy Award in March for her role in historical drama "12 Years a Slave," had already been rumored to be joining the "Star Wars" cast.
Her casting and that of Christie -- who plays female knight Brienne of Tarth in the hit TV series -- were confirmed on the new movie's official website.
"I could not be more excited about Lupita and Gwendoline joining the cast of Episode VII," said Kathleen Kennedy, president of Lucasfilm, which was founded by "Star Wars" creator George Lucas and is now owned by Walt Disney.
"It's thrilling to see this extraordinarily talented ensemble taking shape."
Producers gave no details on the characters the two actresses will play. A spokeswoman for Nyong'o also declined to give any more details.
Original cast members Harrison Ford, Carrie Fisher, Mark Hamill, Anthony Daniels, Peter Mayhew and Kenny Baker will star in the new movie, scheduled for worldwide release on December 18, 2015, and directed by blockbuster filmmaker J.J. Abrams.
Ford, 71, is back as smuggler Han Solo, 62-year-old Hamill will return as Jedi Knight Luke Skywalker and Fisher, 57, reprises the role of Princess Leia.
Other actors already confirmed include Max von Sydow, John Boyega, Daisy Ridley, Adam Driver, Oscar Isaac, Andy Serkis and Domhnall Gleeson. The movie's screenplay is written by Lawrence Kasdan and Abrams.
Disney recruited "Star Trek" and "Mission: Impossible III" director Abrams in a bid to re-create the magic from the original trilogy: "Star Wars", "The Empire Strikes Back" and "Return of the Jedi".
Kennedy, Abrams, and Bryan Burk are producing, while multiple Oscar-winner John Williams returns as the soundtrack composer.