On his 29th birthday, Antonio Colak scored twice as Rangers ended a three-game losing streak.
Colak has nine goals for the season so far.
United hit back when Liam Smith scored.
Rangers wasted good openings to make it a more comfortable contest, while the visiting team pressed in the final stages.
Celtic are in second place and United are in last place.
Fans were angry as a minute's silence was disrupted before the game started.
Ryan Kent and Scott Arfield wasted great chances in front of goal as the hosts made a quick start after suffering three successive losses.
Colak showed how it was done after eight minutes when he drilled in the opener after great work from James.
The Rangers captain robbed Ian Harkes in his own half and raced down the right before laying the ball off at the edge of the penalty area
While United were pinned back for long periods, they did manage a glimpse of goal when Glenn Middleton's shot was saved by the goalkeeper.
The second goal was scored early in the second half when Colak brushed off Charlie Mulgrew and touched a cross from Borna Barisic.
The visitors came out of their shell and were able to reduce the deficit.
Substitute Sadat Anaku made an immediate impact, playing a smart one-two with Tony Watt before finding Jamie McGrath. The full-back's shot went into the net after a touch from the goalie.
Rangers failed to restore their two-goal cushion as United committed more men forward.
In his first league start, Charlie McCann was guilty of a fresh air tackle and goalkeeper CarljohanEriksson made a number of saves to keep the game at a safe distance.
The players were angry that the final whistle sounded even though they had been awarded a corner. The visitors made things difficult for Rangers in the last half hour, but couldn't find a way to equalize. The team is heading in the right direction after a poor start.
In the first 10 minutes, Rangers were almost completely in control of the game. They lost their rhythm as United got more aggressive.
Ryan Jack had an impressive opening 45 minutes, dominating the middle of the park, while Colak's scoring knack proved crucial on a day when the home side had to dig out three points by any means.
It's a big win for us after a difficult few weeks. Today was the most important.
It should have been better. We scored the early goal. We need to kill games before they start. We need to do better. At times, that cost us.
Liam Fox said that he couldn't have asked for any more from the players in terms of attitude and application, but they lost the game.
The players stood up, showed character, and we pushed right to the end, even though we were 2-0 down.
Rangers will play their first league game of the season on October 1st against Hearts. On the same day, there are three home matches between the two teams.