Peralta's red card before the break forced the Gers to dig deep at Ochilview Park, but Law's late second ensured his side would open up a 17-point lead at the top of Scottish League One.
Stenhousemuir should have taken the lead after a scrappy opening as Sean Higgins seized a loose backpass before firing at Cammy Bell, who then kept out Sean Dickson's follow-up.
This close scare sparked Rangers into action as Lee Wallace drove the ball against the bar and they took the lead when Law (35) latched onto Jon Daly's knockdown and slotted past Chris Smith.
But the half ended on a low point for the Light Blues as Arnold Peralta (41) was shown a straight red for a reckless high challenge on Eddie Malone.
Gers boss Ally McCoist reshuffled his side at the break and they went in search of a second, with Lee Wallace's free-kick testing Smith, but at the other end Daly had to clear Malone's dangerous corner.
Stenhousemuir stepped up their search for a leveller and Sean Lynch hooked wide after a poor punch from Bell, while John Gemmell sent a scuffed effort wide of the target.
But Law wrapped up the win in the closing stages as he swapped passes with Daly before lashing a half volley into the net.