I have a 2001 MDX Touring edition, it recently suffered pretty much the same "dent" situation. I found a replacement tailgate in excellent condition in a Metropolitan Atlanta salvage yard for $250 and jumped on the deal, since body shops were showing replacement cost of $650 and up for just the tailgate, total repair cost coming out near $1500. The uncertain piece of info was "what year MDX is this coming off of?" The only assurance they could give me was that it would fit my 2001 MDX. That turns out to be partly true.
A good friend helped me remove the damaged gate last Saturday, and install the replacement. There are just two bolts securing the gate to the body, and they are easy to get to, but first the plastic trim pieces must be removed so that all the electrical connectors can be separated (old and new gates). Then the wiring harness can be pulled out of the damaged gate and set safely aside while you bolt the new gate in. Here is where my troubles began. We found that as we fed the original harness into the new gate that the connectors in the original wiring harness match up ALMOST perfectly to the replacement gate, but after matching most of the connectors, it turned out that there are an unequal number of connectors in the original wiring harness and the new tailgate. That sounds confusing, I need to add that you leave your entire original harness in place in the vehicle that will then connect to the various devices' connectors in the new gate, all of which will still have their original connectors still in place. It ended up that after all POSSIBLE connections were made, there were unmatched functions that don't get power: license plate lights, upper high brake light, and one more that I have forgotten until I go and run the check again.
Because there is a paper strip on the new gate that turns out to be the vehicle VIN, I was able to back trace the VIN and find that the donor vehicle is a 2003 model. So, this means Honda made engineering changes between 2001 and 2003 tailgate harnesses that seem, at this point at least, to have me in an unsolvable riddle. If you are going to make the swap yourself, the only advice I can give is: make sure the donor tailgate is coming from the same model year, 2004 in your case, as your vehicle. Also, I highly recommend that you secure the Acura MDX service manual for your specific year. It will be extremely helpful in finding out how stuff goes together and where wiring goes. I found it somewhere online, free, as a PDF file download. Maybe it was through a post here on MDXers, I just don't recall. That is part of my problem, I am 77 and lots of things just don't recall any more.