I have had good luck looking on ebay or amazon for replacement screens for the specific series which then lists all the models that the display will work on. Then use that info to determine if the display you have with the different part number is really the same display, but different part number because they decided to name the part number different between 2 builds.
This link below suggests that the 5030 display that is the same for N5030 as well as M5030 is different than the N5040. Usually a vendor selling an item with alternate model numbers will include all that the display are compatible with to make the sale on selling this display to someone looking for a similar model, and so you can use this as a good reference as to what would work and what wouldnt.
If both computers are broken, you could still try the other display on the other laptop. I got lucky with a display for a newer Dell Inspiron matching to an old Dell C600 laptop. Both looked the same, but one laptop was a 600Mhz Pentium III and the other was a newer Pentium III 1000Mhz. Unfortunately the better 1000Mhz P3 was toast, and the 600Mhz P3 was good but bad display, so I did the swap between these 2 systems and made a good Pentium 3 600Mhz laptop to run Windows XP SP3 with 512MB RAM on a 40GB IDE HDD that I snagged out of the newer laptop to replace the 12GB HDD.
Also the replacement displays dont seem too expensive on ebay and amazon. I had a laptop once a Toshiba Qosmio that needed a new display and that was priced at $180 and no cheaper alternative. I ended up junking that system because it wasnt worth investing $180 into a 2006 model laptop which cost $2000 new, but of which is only worth like $120 today if it actually worked without problems and was limited due to the nVidia GeForce 7300 Mobile GPU for games.
Edited by goldfist, 20 December 2013 - 08:06 PM.