The signs had looked good for Walter Smith's men when Nikica Jelavic netted his first goal for the club, but Accies looked set to earn a deserved point thanks to an own goal from Madjid Bougherra.
However Rangers ensured all three points would be returning to Ibrox when Miller came off the bench to grab a dramatic last-gasp goal.
Jelavic made his first start for Rangers, after making a cameo appearance in the last outing against St Johnstone, but Richard Foster had to settle for a place on the bench.
Jelavic, Kirk Broadfoot, Maurice Edu and Kyle Lafferty - back from suspension - were all drafted into the starting line-up for the visit to New Douglas Park.
Steven Whittaker missed out through injury and, perhaps mindful of the midweek clash against Manchester United, Miller, Lee McCulloch and Vladimir Weiss were all among the substitutes.
Accies handed a debut to Jim Goodwin but fellow new recruit Damian Casalinuovo started on the bench for the home side.
Hamilton made an early claim for a penalty when Nigel Hasselbaink went to ground in the box after finding himself sandwiched between David Weir and Sasa Papac but the pleas were ignored by referee Alan Muir.
Instead, it was Rangers - in their new all-black third choice kit - who surged into the lead with just six minutes gone when Jelavic claimed his first goal for the Scottish champions.
Lafferty displayed some fine play, slipping the ball through the legs of Andy Graham, and racing down the left flank before picking out the big Croatian striker who bulleted home a header at the back post from 10 yards.
Accies could have levelled when a full-stretch Allan McGregor only just managed to tip an audacious long-range shot from Marco Paixao over the crossbar, before the Rangers goalkeeper was called into action to smother a deflected effort from Jon Routledge.
Broadfoot had taken a knock earlier in the game and was withdrawn as Foster was thrown into the action for his debut a few minutes from half-time.
However, his attempt at a clearance fell to the feet of Hasselbaink and the Rangers man breathed a sigh of relief when McGregor pushed his effort past the upright.
Hamilton continued to push for the equaliser after the restart and were rewarded for their efforts when they drew level after 56 minutes.
Flavio Paixao played the ball out to his twin, Marco, on the left and he whipped a speculative cross into the box which was bundled into his own net by Bougherra at the near post.
With an hour gone, Hasselbaink was withdrawn and Casalinuovo made his first appearance since completing his move to the Lanarkshire club, before McCulloch replaced James Beattie for the visitors.
Steven Naismith tested Tomas Cerny with a point-blank effort which the Accies goalkeeper did well to block, as Rangers desperately tried to restore their advantage.
But the home side also appeared unwilling to settle for the point and Flavio Paixao was not too far away with a curling effort which fell just inches wide of McGregor's left-hand post.
With the champions now toiling in front of goal, Miller - who had netted in every SPL game so far this term - was thrown into the action in place of Lafferty and quickly set up Jelavic but he could find no way past Cerny this time.
Just when it appeared all hope was gone for Walter Smith's men, Miller grabbed the winner with a minute to go. The striker ran on to a McCulloch ball before lobbing the goalkeeper and, despite getting a touch, Cerny could not prevent the goal.