Villarreal held by third tier minnows
Ernesto Valverde's struggling team, who are mired in the la Liga relegation zone with only six points from eight matches, fell behind to an Alvaro Valdes goal in the 14th minute.
Puertollano defender Jorge Juan Pelegrina was shown a straight red card just after half-time before Villarreal's French midfielder Pires celebrated his 36th birthday an equaliser with 25 minutes remaining.
Valverde used all three substitutes and Villarreal had to play the final few minutes with nine men after Spain midfielder Marcos Senna was forced off with an injury and striker Nilmar was red carded for serious foul play in the 76th minute.
"We knew it was going to be a difficult match," Valverde told a news conference. "They came out very motivated, closed us down and were helped by the poor state of the pitch," he added.
"We converted the most difficult chance of the many we created and the good thing is that we still have a very good chance of progressing."
In other matches on Thursday, la Liga side Racing Santander were upset 1-0 at second-division Salamanca and Real Valladolid beat visiting Real Mallorca 2-1 in an all la Liga clash.
The return legs are in two weeks' time.