One of the Bee Gees’ biggest hits featured a surprising contribution from a musician who happened to be recording nearby.