It referred to a "high-pitched, short and somewhat sharp sound" (the bullet pinged off his helmet). SONAR uses noises that sound similar, so SONAR emanations became pings and then it became associated with echo/response at that point.
I thought it came from ping pong. As in you send a "ping" and it responds with a "pong".