The Canadian faced the only break points of the first set, but was able to hold serve, taking the set to a tie-break, which was won by the 11th seed with some solid play from the back of the court.
Gulbis fought back in the second set, attacking his opponent's serve to secure a break mid-way through the set.
Raonic had a chance to break back at 5-4 down, but the Latvian found some big serves to level the match.
Gulbis struggled with his serve in the deciding set, making five double faults and getting just 34% of his deliveries in.
He was able to cancel out an early break from the Canadian, but the errors continued, handing Raonic a place in the last four, where he will face another Canadian, Vasek Pospisil.