With head coach Ronald Koeman on the brink of losing his job, the Catalans trailed early in the game to a goal from Domingos Duarte.
Barca’s desperation was such that Gerard Pique was used as a makeshift striker for the final 15 minutes of the match.
Although their pressure told as Ronald Araujo struck a late equaliser, there is still a sense that there could be a change of coach before the Catalans face Cadiz on Thursday.
They are seventh in the standings on eight points, albeit with a game in hand over many of their rivals.
Madrid had trailed 1-0 to Hugo Duro’s 66th minute goal but strikes from Vinicius Jr on 86 minutes and Karim Benzema on 89 minutes stole the points for the away side.
Valencia stay in third despite their defeat and are on 10 points, three points behind Madrid.
It was the second game in a row that Madrid have won late on after Rodrygo’s 90th minute winner versus Inter in the Champions League on Wednesday.
The three earlier games on Sunday all ended in draws.
The latter result ensured that Real Sociedad remain in the top four at Sevilla’s expense.
Betis recovered from an early Aleix Vidal goal to lead 2-1 through Willian Jose and Nabil Fekir.
However, Leandro Cabrera earned Espanyol a point seven minutes into injury time at the end of the match.
LA LIGA STATISTICS: