Nyom, who made 67 appearances in three seasons at the Hawthorns, was shown a straight red card for elbowing Vinicius Jr in the 77th-minute.
Kylian Mbappe scored the only goal just three minutes later to send Real top of La Liga, before Alex Sancris was also dismissed for Getafe.
Now 37, former Cameroon international Nyom also played in the Premier League for Watford, where he joined West Brom from in 2016.
He played 61 times in his two seasons with Albion in the Premier League, and just twice following their relegation to the Championship in 2018.