Pegged back to 1-1 when Ricardo Costa's own goal levelled after Aritz Aduriz's opener, Los Che then lost their goalscorer to a harsh red card.
They had the last laugh, though, as Juan Mata stole in at the far post to head home Costa's knockdown from an offside position to earn three vital points and go clear above Espanyol in fourth.
Valencia - who somewhat controversially fielded a 4-3-3 formation with Aduriz alone up front - started strongly and had chances to score early on.
Pablo had a shot saved easily by Carlos Kameni and while their wing play was positive, there was little in the way of cutting edge.
Aduriz had a shot well saved in the 13th minute before Pablo headed the resulting corner well only for Jordi Amat to block.
Espanyol suffered a blow in the 15th minute when key striker Pablo Osvaldo was forced off with an injury.
The Perikos pushed forward only tentatively before Javi Marquez had their first chance of note, a 27th-minute shot saved by Vicente Guaita.
Less than two minutes later they were behind, though. Aduriz burst into the box and went down under a challenge from the onrushing Kameni. His penalty appeals were rejected - seemingly correctly - and from the corner that followed, Aduriz met Joaquin's kick to head home.
Marquez missed another chance for Espanyol while at the other end, Mata headed wide.
And in the opening few seconds of first-half injury-time, the Barcelona-based side were fortuitously level as Costa dived to head clear a teasing cross but, seemingly in no danger, could only direct the ball into his own net.
Unai Emery's side pushed to regain the lead but looked deflated in the second half.
Their frustration was clear when Aduriz was sent off just after the hour mark. Marked by Francisco Chica, the Basque shrugged his arm only slightly aggressively and caught his opponent's arm, prompting Chica to collapse dramatically and earn his nemesis a red card.
Mata's impressive volley was well saved by Kameni while Jesus Datolo was just as unfortunate to be denied at the other end.
Espanyol's Jose Maria Callejon saw his shot superbly pushed away by Vicente again and the goalkeeper also had to react smartly to deny the same player.
Pablo had a half-chance for Valencia as the game fizzled out only for Mata to slam home the winner in the second minute of added time.