You could but ...
So you would have to remove not only the modern engine but the transmission as well and you may have to find a differential with a ratio that will work with the old transmission. Installing a clutch pedal and master cylinder or an automatic shifter and its linkage. You may have a bugger of a time trying to defeat programs for the ignition, most of the modern dash instruments would be dark and you would need to wire up some old school gauges for the tach, speedo, temp, fuel level and such.
In fact, forget about using the modern start ignition altogether and install and old one with a key or just a push button. 240z rack&pinion steering is not going to be fun to use, if you stay with the modern hydraulic steering pump then you need to hobble together a mount to support it on the L engine. Electric steering would be the easiest route to go. You may have to scrap the entire ABS system.
Depending on which L series engine you use, you may have to work a choke cable through the firewall. There's LOTS of other problems you would have to sort out along the way.
There are lots projects similar to this that get started and never finished, or if finished have so many compromises that the end result is iffy. It's much much easier to put a modern engine in an old car. But yes, it could be done.