Karim Benzema scored just before the break and an own goal from Andres Guardado in the 74th minute gave Jose Mourinho's side the advantage in the quarter-final ahead of next week's return at the Mestalla.
The winners go on to meet either holders Barcelona or Malaga, who meet at the Nou Camp on Wednesday.
On the other side of the draw, Real Zaragoza host Sevilla on Wednesday, and Atletico Madrid receive Real Betis on Thursday.
"It is a good result," Real captain Iker Casillas told reporters, "But the way forward in the cup is very tough.
"We have the return leg away and after that, if we progress, a meeting with either Barca or Malaga, who are in good form. But the victory gives us a lift and helps us get over our frustrations in La Liga."
After a recent poor run of form which has seen Real slip 18 points behind league leaders Barcelona, Mourinho's name once again was met with a mixture of whistles and applause before the start of the 600th top-flight match of his career.
Brazil full-back Marcelo was back in the side after almost three months out with a foot injury but first-choice centre-backs Sergio Ramos and Pepe were missing through suspension and injury respectively.
Luka Modric fluffed an early chance for the hosts and Iker Casillas pulled off a great reflex save to deny Jonas.
As so often happens with Real, a close chance at one end turned into a goal at the other, as Michael Essien burst away on a counter-attack.
He fed Sami Khedira, who immediately laid off for Benzema and the hosts were 1-0 up in the 37th minute.
Valencia carved the perfect opportunity to equalise midway through the second half, after good work by Ever Banega, but when Casillas parried Roberto Soldado's shot Jonas fired wide of the gaping goal.
As with the first goal, Real immediately struck back.
Substitute Fabio Coentrao's low cross was turned into the net by a combination of Guardado and Gonzalo Higuain as the two slid in at the near post, the Argentine getting the final touch with his hand.
Valencia's new coach Ernesto Valverde was sent off after the goal, though he was sanguine when asked if he was unhappy with the referee.
"It's a lot easier when you see it on the television," Valverde told a news conference. "We have to try and put ourselves in their place.
"Perhaps when I see it on the television it will hurt more. We had chances to score and this is more painful."
Valencia keeper Vicente Guaita denied Cristiano Ronaldo with two magnificent saves towards the end to keep his side's hopes alive in the tie.
Thank you for reading 5 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1