Pepe admits Real Madrid were “hated” when Real Madrid was in charge of the Spanish giants.
Mourinho spent three years at the Bernabeu, winning a La Liga title, Copa del Rey and Spanish Super Cup.
However, the Portuguese also became embroiled in a number of spats with then Barcelona boss Pep Guardiola and Real captain Iker Casillas.
“Under Mourinho, people hated us when we got out there,” Pepe told Cadena Ser.
“It lasted three years and thank God it went very quick. Things changed when [Carlo] Ancelotti came in, you could see people started treating us different again.”
While Pepe was one of a number of players to endure a difficult relationship with Mourinho, the Portugal defender enjoys playing under current boss Zinedine Zidane.
“What happened with Mourinho is in the past now. I was strong and got over it. I maintained my high level at Madrid,” he added.
“Mourinho and Zidane are very different, one could say they are opposites. But it’s not like one is bad and the other is good.
“Mourinho has a lot of experience as a coach, with great clubs and players. Zidane has only just started in La Liga last year. But he has played at the highest level himself and always knows what’s expected on the pitch.
“Zidane has been a player and knows what we think. He had a brilliant career at Madrid, so understands what the pressure is like here.”