United Parcel Service Inc. and its pilots union have reached a tentative agreement on a new contract, which, if approved, would end a stalemate that dragged on for more than three years and included the pilots' threat of a strike, the union said Friday.