Philippe Clement's side were rocked by Andy Halliday's opener at Hampden Park and furious Rangers fans booed their players off at half-time.
But Cyriel Dessers levelled from close range in the 49th minute before Nedim Bajrami fired the winner with nine minutes left in the semi-final at Hampden Park.
Holders Rangers will face Celtic in the final on December 15 after their hated Glasgow neighbours crushed Aberdeen 6-0 in the other semi-final on Saturday.
Scottish champions Celtic are nine points ahead of Rangers in the domestic table after a disappointing start to the season for the Ibrox club.
Motherwell scored with their first chance in the 25th minute as Steve Seddon crossed for Halliday to poke his shot past keeper Jack Butland before refusing to celebrate against his old team.
Rangers' response was a powerful 20-yard drive from Connor Barron which was pushed round the post by Aston Oxborough.
An anti-board banner was revealed by the Union Bears, Rangers' ultras-style fans group, and the boos soon followed as Clement's men struggled to find any rhythm.
Rangers' problems increased when the injured Tom Lawrence was replaced by Mohamed Diomande.
Diomande's curling shot was parried by Oxborough, but Dessers somehow missed the target with the loose ball.
Oxborough made another save from a John Souttar header just before the break.
Dessers got Rangers back on level terms when he converted Barron's pass from six yards.
As Rangers increased the pressure, Jefte cracked the post with a left-footed drive from the edge of the box and James Tavernier lofted a Bajrami pass over the bar from six yards.
Vaclav Cerny had two attempts thwarted by Oxborough before Rangers finally went ahead in the 81st minute.
They broke with pace and Cerny turned inside to set up Bajrami, whose shot from a tight angle clipped Kofi Balmer and sped past Oxborough.