The Latvian admitted that he struggled against the Wimbledon champion in the first set, but grew in confidence as the match progressed.
"The thing that pleased me the most was that I won," Gulbis told BBC Sport.
"I struggled in the first set from the baseline but got more confident and took my chances. I didn't blink when serving out for the match but I didn't play my best tennis. I hope I will be even better tomorrow."