The title remains the only grand slam to have eluded the Serb in his glittering career, but he secured a sixth semi-final appearance nonetheless.
Eighth seed Raonic fired 21 aces in the contest, as the finest of margins saw Djokovic home in the opening two sets.
However, the 23-year-old's usually strong service game fell away in the decider, allowing the world number two to race clear before securing a well-earned victory.
Djokovic will now face 18th seed Ernests Gulbis in the semi-finals, and will take confidence from a 4-1 head-to-head record over the Latvian.
The first set was an even affair, Raonic making the most of his big serve to keep the pressure on Djokovic.
Djokovic passed up a chance to break Raonic and take the set at 5-4, but finally broke the Canadian's serve to avoid a tie-break, coming up with a cross-court backhand which Raonic could only volley into the net.
The second set was characterised by dominant serving from each player - just 13 points were scored against either's serve to force a shootout.
Djokovic again had to dig deep in a tight affair, forcing a backhand error out of the Canadian with a serve out wide.
For the first time in the match the gap in class seemed evident in the third set, Djokovic breaking immediately when Raonic sent a forehand long.
The Serb rammed home that advantage in game three, Raonic netting a weak backhand as the second seed moved through the gears.
At 5-1 up, Djokovic showed a slight wobble as Raonic took three straight games, but the former recovered and sealed his passage into the last four when the Canadian sent a forehand wide.