Hmmm..... 5000px at 72dpi means that the fence must be 125,17meters high. Are you sure about this?
Do you realy need this kind of huge resolution?If so, you can make use of the "split Scan Lines" option in Backburner.https://knowledge.autodesk.com/support/3ds-max/learn-explore/caas/screencast/Main/Details/2b40e1a3-9c30-4743-b519-40626f7e9b39.html
render it at 32000px and blow it up in photoshop
I think that the problem is still with setting up the longer edge output value. It's limited to around 32 000px in 3ds max.Do you think that there is any script which could slice that view with cameras or something? Or any other way?