The on-loan Arsenal defender grabbed what proved to be the only goal of the game in the first half, with the win allowing Rangers to move back to within five points of Celtic with two games in hand.
The victory for the depleted Ibrox side also provided a timely boost ahead of their Europa League last-16 clash with PSV Eindhoven on Thursday.
Rangers made one change from their Scottish Cup exit to Celtic on Wednesday night. Sasa Papac was ruled out after suffering a head knock at Parkhead and David Healy was drafted into the starting line-up.
With eight players sidelined for the trip to Paisley, the Scottish champions were able to name just six substitutes, including under-19s striker Kane Hemmings who was on the bench for the first time.
Saints made three changes from their defeat to Kilmarnock, with Lee Mair recovering from illness, Paul McGowan back from suspension and Kenny McLean also starting.
Marc McAusland and Craig Dargo were named on the bench after picking up slight injuries, while Darren McGregor missed out because of personal reasons.
Rangers dominated the possession in the opening spell and could have been ahead early on.
El-Hadji Diouf slipped the pass through for Healy in front of goal who took a touch before unleashing the shot. His effort was smothered by goalkeeper Paul Gallacher but the offside flag was raised anyway.
At the other end, Steven Thomson picked out Michael Higdon at the back post but he connected awkwardly with the shot and Madjid Bougherra was able to clear the danger.
John Potter’s ferocious header was then hooked off the line by John Fleck as Saints pressed for the opener.
Rangers withstood the flurry of chances from the home side and could have had the net bulging when Steven Davis curled a dangerous free-kick into the box but Gallacher was able to produce a one-handed save and tip over.
The Ibrox side were ahead after 24 minutes when Bougherra’s cross from the left flank was met by Bartley at the back post and he rose above everyone in the goal-mouth to send a header into the back of the net from close range.
Saints could have been back on level terms when David van Zanten teed up the shot for McLean but he blasted over, without really testing Allan McGregor in the Rangers goal.
St Mirren were first back onto the pitch after the break and clearly felt they were capable of hauling themselves back into the game.
McLean’s corner shortly after the restart sailed above everyone in the box before falling for McGowan but he was well off target with the shot.
Rangers were threatening with a corner of their own as they chased a second goal, Fleck picking out Maurice Edu 12 yards out and his volley dipping over the crossbar.
Rangers made a double change with 20 minutes to go, as Healy and Fleck were withdrawn for Kyle Hutton and Gregg Wylde.
But it was Edu who should have doubled the advantage when he collected a Davis ball and looked set to smash home only to see his effort fizz across the face of goal and wide instead.
Walter Smith’s men had the chance to pile on the pressure when Diouf was tripped on the edge of the area by Hugh Murray, but Wylde’s resultant free-kick crashed off the Saints wall, before the home side swapped Jim Goodwin for Dargo.
But they failed to find the goal that would give them the point as Rangers held on for the win.