We present an identity satisfied by the kinematic factors of diagrams describing the tree amplitudes of massless gauge theories. This identity is a kinematic analog of the Jacobi identity for color factors. Using this we find new relations between color-ordered partial amplitudes. We discuss applications to multi-loop calculations via the unitarity method. In particular, we illustrate the relations between different contributions to a two-loop four-point QCD amplitude. We also use this identity to reorganize gravity tree amplitudes diagram by diagram, offering new insight into the structure of the KLT relations between gauge and gravity tree amplitudes. This can be used to obtain novel relations similar to the KLT ones. We expect this to be helpful in higher-loop studies of the ultraviolet properties of gravity theories.