First off
Welcome to NICO !!!!
There are several things that can cause the stalling but not getting past 4K is quite odd.
The knock sensor is ignored after 3K so we can eliminate that.
Has the Fuel filter been replaced ?
If I recall there is three stages of flow from the fuel pump.
If the FPU is defective it might cause this.
I would think 4k is when the FPU is in WOT mode. (Highest fuel pressure).
Only way to rule out fuel is to T off a fuel pressure gauge and see if its within spec.
In case you don't have the FSM here is the link to download.
http://www.nicoclub.com/FSM/J30