Top seed Richard Gasquet reached the quarter-finals of the Kremlin Cup with a 6-3 3-6 6-1 win over Russia's Evgeny Donskoy.