Chain of Attack by Gene DeWeese
While mapping a series of gravitational anomalies, the U.S.S. Enterprise is suddenly hurled millions of light-years through space, into a distant galaxy of scorched and lifeless worlds, into the middle of an endless interstellar war. With no way back home, the crippled starship finds itself under relentless and suicidal attack by both warring fleets. And Captain Kirk must gamble the lives of his crew on his ability to stop a war that has raged for centuries, and ravaged a galaxy.