Los Blancos came close to surrendering a three-goal lead on Saturday and the Portugal international has warned his side not to let their intensity drop in future matches
Los Blancos raced into a three-goal lead at Vallecas, with Cristiano Ronaldo striking either side of a Karim Benzema header, but they were left hanging on at the end after conceding two penalties in as many minutes in the second half, both of which were converted by Jonathan Viera.
Given Madrid shipped three goals in midweek against Sevilla and have conceded more than any other side in La Liga's top half, Pepe admits that Madrid's vulnerability at the back has become a serious cause for concern among the players.
"We are all down about it," the 30-year-old centre-half told his club's official website.
"In the second half, we didn't have the right intensity but the most important thing is to recognise it, and that it has happened in the last two matches and cannot happen again.
"But I think that we were very good in the first half. The team worked hard, with a lot of intensity, we had control and we moved well.
"The coach told us at half-time that we had to keep going because Rayo Vallecano are a mentally strong team.
"But they came out very strongly after the break at home in front of their fans and picked up the pace, which we struggled more against.
"The most important thing, though, is that we took the three points at a difficult ground to win at."
Pepe also confessed that Madrid's players might have had one eye on Tuesday night's Champions League showdown with Juventus in Turin having surged into a three-goal lead against their neighbours shortly after the break.
"We made mistakes in the second half," the Portugal international continued. "We should have had the match under control and maybe even started to think about Juventus.
"I think we're doing well, though. We scored three goals at a difficult ground to come to.
"We got an important win before a tough match. Real Madrid go out to win wherever we play and that is what we'll keep doing."