The Reds are seven points behind Premier League leaders Manchester United but Mascherano believes they can close the gap.
The midfielder said: “That win against Real will give us more confidence.
“It was amazing to win in Madrid but now we need to think about the next games.
“You never know if Manchester United can drop some points at any time, so we are happy and we need to keep going.
“We are more confident — now we have to beat Middlesbrough on Saturday to still have a chance.
“It will be really difficult so we have to play in the same way, with the same concentration.
“We have to keep working hard and we will see what happens.”