Loss compensation and super-resolution with excitations at complex frequencies