Defender Steven Whittaker sent a superb drive into the far corner of the net just after the break.
Kris Boyd scored from the penalty spot 20 minutes later after Sol Bamba was ruled to have fouled Kenny Miller, who rolled in the third in stoppage time.
"We knew how big the game was," Whittaker told Sky Sports 1.
"It was important we were on top of our game today. We dug in fantastically and deserved it."
He added: "We won't take anything for granted. We've got a lead but it's important we just keep picking up points."
Defender Madjid Bougherra said Rangers were rewarded for their patience.
"The first half was very tough," he said. "They're doing very well this season.
"We were very patient. The first goal came in the second half. The game was still open and we scored two more."
He added: "We had two draws the last two games and we needed to keep the confidence for the fans and the team.
"I hope we do the treble but it's going to be very hard."