It seemed Murray was on course to come from behind to win the match when he led 4-1 in the deciding set, but the difference was only a single break and Raonic reeled him in, saving two match points and winning 6-3 6-7 (7/5) 7-6 (7/4).
Raonic, 21, stands at a career-high ranking of 15th in the world and toppling the US Open champion in Tokyo goes down as the biggest win of his career so far.
When Murray beat Raonic in straight sets in the last 16 on the way to his slam success in New York last month, the Scot predicted their next contest would be "much tougher", and how right he was.
His point was emphasised when Raonic broke serve in the opening game, and again to take the first set when Murray hooked a backhand out of court.
Murray saved a break point in the second game of the second set - a bold second serve finding the centre line - but his performance was leaden-footed, the brutal serve and ground shots of his opponent holding sway.
Talking to himself, imploring himself to step up a gear, Murray nevertheless struggled to make inroads.
He saved another break point and would have welcomed the tie-break, in which his game finally came alive.
Terrific defence from the Scot saw him engineer a set point at 6-5, with Raonic sending a volley long. And a cross-court backhand then tied up Raonic in the corner, to the effect he could barely put a racquet on the ball.
The set was Murray's, and it appeared he would sprint through the decider when he broke for 3-1, sending a backhand searing into the corner, before holding.
Yet Raonic was not finished and broke back in game seven, showing little sign of fatigue despite having been taken to a third-set tie-break by Janko Tipsarevic in his quarter-final.
Murray made his opponent serve to stay in the match at 6-5, and when Raonic double-faulted at 30-all there was a first match point.
A big serve out wide and smash at the net staved off that danger, and then Raonic double-faulted again. Murray missed a backhand on his second match point, and Raonic took the game with a brilliant low volley.
Reward for refusing to give in to the world number three came when Raonic took both points against Murray's serve from 4-3, giving him three match points.
He wasted the first with another double fault but not the next, leaving Murray frustrated with himself and beaten.
The second semi-final was a much more one-sided affair as Kei Nishikori delighted the home audience by beating Baghdatis 6-2 6-2, becoming the first Japanese player ever to reach the final at this event.
Eighth seed Nishikori took the initiative from the outset, continuing where he left off in his straight-sets semi-final win over second seed Tomas Berdych yesterday.
The 22-year-old world number 17 needed only 61 minutes to advance to his first final of 2012, his powerful hitting proving too much for his Cypriot opponent.
Two breaks of serve in each set saw Nishikori storm to victory and keep him on course for a first title since claiming the 2008 Delray Beach title as a qualifier.