M5400 used a 1366 x768 Touch screen and the connector is in a different spot than that display so no it won't work.
This is like asking if a car has 4 wheels are all the parts interchangeable. 😉 When you say 40 pin connector it looks something like this.
Resolution
4 options
Backlight type
4 options
Display Size
5 options
Panel Type
4 options
Connector location
6 options
Built-in WIFI Antenna
2 options yes or no
With Routed Camera wiring
2 options yes or no
Touch screen or No Touch screen
2 options yes or no
How many different combinations do you have there? How many different ways are the wiring going to vary provided it has one or more custom options?