Mine does the same thing but only sometimes. Fought with it for months trying multiple things. Never found the REAL fix.
I did find that if I ran a seperate wire to the starter solenoid, it would crank and start. Now I have a starter switch installed on the lower dash. When it will not start, I leave the key in the ON position and push the button. It applies 12v directly to the starter solenoid, bypassing everything else. Works everytime.
Try just running an extra wire from the solenoid to near the battery. When it does not start, touch the wire to the + battery post and see if it cranks. Careful if you have a manual trans cause it will run you down.
__________________
'86 4runner, 22RE, auto, 4" ProComp lift, 33x12.5 BFG All-Terrains on 15" A/R rims, clear lens front & rear, 260,000+ miles. Wanting 4.88 gears and soft-top.
'88 4runner, V6, 5spd, sunroof, power everything, 185,000+ miles.