Second-half goals from Ryan Flynn and Ben Davies handed Nigel Clough’s team all three points – and saw them finish seventh in the table – after Nathan Delfouneso had given the visitors the lead.
Neill Collins went close to extending United’s advantage soon after Davies’ intervention with Michael Doyle also trying his luck from long range during a hugely entertaining match which suggested both teams can challenge for promotion next season.
Callum Wilson threatened on the counter attack for City but, for the most part, it was United who seemed more likely to break the deadlock – until Delfouneso pounced.
Conor Coady, playing the final game of his loan from Liverpool, tested goalkeeper Joe Murphy from long range before Doyle twice forced the City captain to make smart saves.
But, six minutes before the interval, the visitors were also indebted to referee Darren Bond for playing an advantage after John Fleck had been fouled which allowed the former Rangers youngster to release Delfouneso who slipped the ball beneath the onrushing Mark Howard.
It was tough luck on United who also saw Flynn go close during the first half, although Wilson did test Howard again moments before half-time.
The excellent John Brayford fired just over the crossbar from an acute angle as United searched for a route back into the game.
It duly arrived in the shape of a superb 62nd-minute goal with Flynn showing excellent composure after exchanging passes with Coady before engineering enough space inside a crowded penalty to slide home his shot.
Coady, like Brayford, had caused City problems all afternoon and, in the 73rd minute, he unselfishly found Davies in space which allowed the substitute to fire United in front.
Collins, making his return from injury, could have extended their advantage soon afterwards but headed over the crossbar.