A shock appeared to be on the cards in the early stages at Roland Garros as Kubot raced into a 4-0 lead in the opening set, breaking Gulbis in his first two service games.
The Latvian managed to pull one break back in the eighth game, but Kubot held out to take the first set 6-4 at the second time of asking.
Gulbis made a better start to the next set, holding serve twice before breaking the world number 63 to take control of proceedings.
Kubot responded immediately by breaking back in the very next game, but it was only a temporary reprieve as Gulbis won against the serve once more to clinch the set 6-4.
The world number 17 held on to his own serve in a mammoth fifth game of the third before finally finding the breakthrough to win the set 7-5 and put himself within touching distance of the second round.