Omeruo was handed his 15th league appearance this season, pairing his compatriot Chidozie Awaziem at the heart of Leganes’ defence.
Alexander Isak put Real Sociedad ahead in the 20th minute, while Omeruo equalised for the hosts four minutes after the break after he was set up by Martin Braithwaite.
Oscar then grabbed the match-winning goal at the death to help Javier Aguirre’s men clinch their fourth win of the season in front of their own fans.
Despite the victory, Leganes remain in the bottom three of the league table with 18 points from 22 games.
They will hope to brighten their chances of avoiding relegation at the end of the season with a victory against Levante on February 8.