Salah, who has not been at his best since returning from injury last month, was brought on in the 79th minute, just after the Hammers' second goal levelled the game
Marcus Thuram fired in for the lead with the hosts' first chance of the game in the 33rd minute and tapped in on the rebound in the 58th just as Real were pushing for an equaliser.
But Karim Benzema cut the deficit in the 87th minute and Casemiro got the equaliser in stoppage time.
The 13-time European champions, who had lost their previous three games following last season's two defeats to Manchester City in the knockout stage and their shock 3-2 loss to Shakhtar Donetsk last week, earned their first point in the competition.
Gladbach are in second place on two points, with Shakhtar top on four after a 0-0 draw with Inter Milan.