Jese found a gap between Valencia goalkeeper Vicente Guaita and his near post with eight minutes left to give Madrid the spoils in a match which saw the managerless home side twice fight back from a goal down.
Angel Di Maria (28) and Cristiano Ronaldo (40) had put the visitors ahead but Valencia had levelled both times through headers from Pablo Piatti (34) and Jeremy Mathieu (62).
The hosts, who were being led by youth-team coach Nico Estevez following Monday's departure of Miroslav Djukic, could not find a third equaliser following Jese's goal though as Madrid kept the pressure up on top two Barcelona and Atletico Madrid.
Madrid have enjoyed tremendous success in this fixture in recent years, winning on their previous four league visits to Valencia, while in the last six years have recorded victories by 5-1, 6-3 and 5-0 here.
They had also claimed a couple of 3-2 wins at the Mestalla in that time, so goals were always on the cards - and so it proved.
Di Maria netted the opener with a superb effort just before the half-hour, the Argentina winger bringing down a cross-field pass from Marcelo before skipping in between two defenders as he made his way into the area and then curling a shot just inside the far post.
Valencia were behind for just six minutes though before Piatti drew them level when he got in the end of Juan Bernat's cross to glance home a header from six yards out.
Madrid refused to be deflated however, and Di Maria drew a fine save out of Guaita soon after before Ronaldo restored the capital club's lead when he headed home the winger's free-kick unchallenged from near the penalty spot.
That left Madrid ahead at the break but once again Carlo Ancelotti's men failed to hold on to their lead as they were undone by another header as Valencia made it 2-2 just after the hour.
Piatti swung over a corner from the left and Mathieu climbed above Sergio Ramos in the box to power a header above Lopez and into the net,
For a while that looked set to earn Valencia a point, but their defence was breached for a third time in the closing stages following an error in judgment from Guaita, and this time there was no way back for Los Che.
Luka Modric won the ball back on the edge of the Valencia box and fed the unmarked Jese on the right side of the area. The angle looked too tight for the 20-year-old but he tried his luck any way and was rewarded as his shot sneaked past Guaita and into the net for the match winner.