G'day Phil,
I've no clue if the plugs are compatible, let alone the programming, the registers and codes (PIDs) that store information about the vehicle.
IF the plugs are the same, you'd have to check that each pin in each connector was the same in both - disaster could strike otherwise. That still doesn't mean the programming is going to be the same - but you'd at least be able to try it and see.
I fear that the D22/Patrol might have similar differences to the D22/D40 2.5s (like the D40-128Kw and D40-140Kw) - the heads are different, flows are different, perhaps compression ratios too.
I wonder if a chip isn't a safer path - Robert from ChipIt has posted about increasing the D22's output by a significant amount - but it'd sure be interesting to find the answer!