Yes, you can recover your iPhone data even if the screen turns black and the device is not accessible. However, the recovery method will depend on whether your iPhone trusts the connected computer.
1. If the computer is trusted: You can directly recover data from any iOS device using Stellar Data Recovery for iPhone.
2. If the computer is not trusted: Recover your data from iTunes or iCloud backup, if available.