I've never used a pi, but it should be possible to mount the root partition and edit the /etc/network/interfaces or /etc/dhcpcd.conf file, or /etc/NetworkManager/conf.d/* if you have NetworkManager (systemctl status NetworkManager to check).
You should also make sure that sshd is listening for connections from any address (0.0.0.0 and ::).