The world No. 1 and defending Madrid champion overcame a poor second set to post a 6-2, 2-6, 6-3 decision over Gimeno-Traver, who had beaten the Serb superstar on a clay court in 2006.
Djokovic needed 106 minutes to get past the Spaniard and advance to the Round of 16, where he will take on the winner of a match-up between Stan Wawrinka and Jurgen Melzer.
Juan Martin del Potro, who is coming off last week's title in Estoril, Portugal, fired eight aces Tuesday in dispatching German Florian Mayer 6-4, 6-2. The 11th-seeded Argentine will take on Russian Mikhail Youzhny in a Wednesday second-round match.
Sixth-seeded Czech Tomas Berdych logged a second-round victory, handling South African Kevin Anderson 6-4, 6-3.
Gal Gadot cast as Wonder Woman for 'Batman vs. Superman'
Kate Middleton recycles dress at movie premiere