A blistering first-half, which included the Elrich goal and strikes from Miguel Palanca and Pablo Sanchez had the Reds 3-0 up at the break.
Two second-half penalties made it 4-1 before Kew Jaliens and Michael Marrone were both sent off in the dying stages of the contest.
Adelaide required all three points to maintain its hopes of leapfrogging Wellington Phoenix to finish third and face Brisbane Roar, rather than City in the first round of the finals.
United was full of attacking intent from the start and put the visitor's goal under sustained pressure early on.
On 18 minutes the Reds made their domination count. A swift move had Sanchez driving at the City defence and he slipped Miguel Palanca through on goal.
The Spaniard side-footed his shot past Tando Velaphi to give Adelaide a 1-0 lead and his coach food for thought, with the attacker's contract set to expire at the end of the season.
It took just five minutes for the home side to double its lead. A long ball over the top found Sergio Cirio in the area.
His curling shot was beaten away by Velaphi, but Sanchez was first to the loose ball and hammered home to make it 2-0.
City's best chance of the opening stages came on the half hour after a long-range shot was spilled by Eugene Galekovic and Jonatan Germano blasted the follow-up effort over the bar.
There was no stopping Adelaide and Elrich on 33 minutes in what was a contender for goal of the season.
The defender picked up the ball inside his own half then slalomed his way through the opposition defence, beating three players along the way before slotting a shot past Velaphi to make it 3-0.
The Reds were able to extend their lead 15 minutes after the interval. Germano brought down Craig Goodwin in the box.
Substitue Cameron Watson stepped up to slot in the penalty at the second time of asking and score his first A-League goal in 105 matches.
City had its own chance to hit back from the spot just past the hour as Bruce Kamau brought down Aaron Mooy. The midfielder stepped up to dispatch the penalty and reduce the deficit.
The visitor's joy was short lived. Jaliens brought down Goodwin outside the area as he bore down on goal. The City defender was shown red for preventing a goalscoring opportunity.
Both teams were down to 10 men soon after as Michael Marrone was sent off for a dangerous tackle on Erik Paartalu.
Neither side was able to add to the score as Adelaide secured a 4-1 win.
Adelaide coach Josep Gombau was delighted with the Reds' performance.
"I think that we did well," Gombau said.
"In the end, there is a good feeling for next week, the finals.
"Today we win, but (the) important (thing) is next week."
Melbourne boss Jon Van 't Schip slammed his side's opening half-hour.
"I think we were not in the game at all the first half-hour," he said.
"Before we knew, we were 3-0 behind.
"Adelaide deserved more than the win."