On the second real eigenvalue of nonegative and Z-matrices