Law bent home the winner 11 minutes into the first extra period at Ibrox on what was Hibs boss Alan Stubbs’ managerial debut.
Danny Handling (59) had earlier cancelled out a Lewis Macleod (14) opener only to leave Hibs a man short when he was sent off.
Handling’s 79th-minute dismissal – a straight red card for a foul on David Templeton – gave the initiative back to the home side, who now go on to host Barry Ferguson’s Clyde in the competition’s south section.
Rangers started quickly against opponents likely to be among their main rivals for promotion from this season’s Championship, and they were ahead when Macleod fired a low 20-yard shot underneath unsighted keeper Mark Oxley’s dive.
Kris Boyd was denied by a linesman’s flag as Rangers threatened a second, but Hibs came into the game as half-time approached and emerged from the break the stronger side.
Sam Stanton might have equalised when he went through on goal, and Rangers’ defence opened up again as Handling beat Cammy Bell to level the scores.
Farid El Alagui wasted a great chance to put Hibs in front on his first start for the club, slicing over from eight yards, and the visitors were down to 10 men when Handling took out Templeton.
Rangers took advantage and although Boyd fluffed his lines with an opportunity to win it inside 90 minutes, Law used his marker as a screen to beat Oxley with a lovely finish.