The local driver was left without information on his dashboard, including lap times, and in the end he was relieved to recover to earn fourth on the grid for Sunday’s race.
The electrical issue also created a DRS problem that left him seventh in Q1, although that problem was rectified for the later sessions.
Perez then got through Q2 in fifth place before improving by one spot in the final part of qualifying.
"It was a mess, a total mess," he said of qualifying.
"We had an electrical issue from the beginning but, if I look back at my quali, I was nearly knocked out in Q1, nearly in Q2, I had no reference to progress, I had no lap times.
"Sometimes I could not figure out where I was with my brake balance either. So it was a total mess, but in the end I think P4 is not the worst bit, but I think certainly we could have been quite a lot higher than we are."
Following investigations by the team Christian Horner confirmed to Autosport that the electrical issue was caused by a faulty sensor, believe to be related to a GPS/TV channel operated by FOM.'
Asked by Autosport about his Q1 DRS problem, Perez said: "It was all to do with the electrical issue that we had throughout the quali.
"Basically I had no reference with lap times and so on. [DRS] came back, the only thing that didn't come back was my electrical. They are confident that they can sort that out [for the race]."
Perez admitted that it was particularly painful to endure such a difficult session at his home event.
"Obviously if there's a quali that you want to have everything perfect, it's this one, especially given how close we were to pole, I think certainly we would have progressed much more than what we did," he said.
But Perez did acknowledge that he could use the traditional Mexico City tow off the grid to gain ground on the first lap.
"I think there's a lot of things we can do for tomorrow, so we will try our very best," he added.
"Tomorrow I just want to win and I will do my best into Turn 1, and see what happens."
Asked if he will be aggressive, he said: "Yeah. Mainly into Turn 1! Because, after that, it can be a bit chaotic, and at the stops, it will be all about that."