Dani Parejo cancelled out a Cristiano Ronaldo header to leave the two teams level entering the latter stages, but Marcelo's curling effort ensured that title-chasing Los Blancos would record a vital win.
Real Madrid boss Zinedine Zidane made eight changes to the team that started against Deportivo La Coruna last time out, with Nacho, Marcelo and James Rodriguez the only three to keep their spots in the XI.
As for Valencia, Joao Cancelo and Simone Zaza both missed out through suspension, while club captain Enzo Perez was still injured. There was just a fourth La Liga start of the season for 19-year-old Toni Lato at left-back, while Munir El Haddadi, Fabian Orellana and Nani supported lone forward Santi Mina.
The visitors had a glorious chance to take the lead in the second minute when Mina, who capitalised on a poor defensive header from Ramos, broke into the Real Madrid box before testing Keylor Navas. The ball then broke straight back to the Valencia forward, but his low effort hit the outside of the post.
Real Madrid's first attempt on target came in the 12th minute when Benzema met a deep cross from Dani Carvajal, but the Frenchman's header was straight into the arms of Los Che goalkeeper Diego Alves.
Valencia remained a threat on the counter-attack, however, and Orellana sent one just wide of the post in the 17th minute after finding space between Real Madrid's two centre-backs.
A long-range Ronaldo free kick missed the Valencia crossbar in the 22nd minute, but the Portugal captain sent Real Madrid ahead with his 20th La Liga goal of the 2016-17 campaign five minutes later when he headed a brilliant Carvajal cross into the back of the net from close range.
Opportunities were few and far between in the latter stages of the first period, however, as Los Blancos entered the half-time break with just a one-goal advantage to show for their efforts.
Valencia had a half-chance to level the scores in the 52nd minute when Carlos Soler found some space inside the Real Madrid box before hooking the ball towards the far corner, but it just cleared Navas's goal.
Real Madrid were then awarded a penalty in the 55th minute when Los Che captain Parejo clumsily felled Luka Modric inside the Valencia penalty box, moments after Benzema had rattled the post with a curling effort.
Ronaldo stepped up looking to double Real Madrid's lead, but penalty specialist Alves made a brilliant save as Valencia stayed in the match with little over 30 minutes remaining in the Spanish capital.
Benzema had another half-chance in the 63rd minute after working some space just outside the Valencia box, but the Frenchman missed the crossbar with a curling effort.
Valencia had a golden chance to level the scores 20 minutes from time when second-half substitute Rodrigo Moreno headed a Martin Montoya cross towards the top corner, but his effort just missed the post as the score stayed 1-0.
Ronaldo then had an even better opportunity for Real Madrid after meeting a far-post cross from Marco Asensio, but somehow the attacker turned the ball wide of the post from close range.
Valencia incredibly levelled the scores in the 82nd minute when Parejo bent a free kick into the top corner, stunning the Bernabeu into silence with little under 10 minutes of football remaining in the Spanish capital.
The response from Real Madrid was strong, however, and the home side regained the lead in the 86th minute courtesy of a brilliant individual goal from Marcelo, who ensured that his team would move three points clear of Barcelona ahead of their trip to Catalan rivals Espanyol on Saturday night.
Real Madrid will now switch their attention to the first leg of their Champions League semi-final at home to Atletico Madrid on Tuesday night, while next up for Valencia is a home La Liga fixture against already-relegated Osasuna next weekend.