The Coyotes gave Tampa Bay a sixth-round pick next year for Gagner and right wing B.J. Crombeen.
The 24-year-old Gagner, the No. 6 pick in the 2007 draft, had 10 goals and 27 assists in 67 games last season. He had 101 goals and 194 assists in 481 games in seven seasons with the Oilers.
Crombeen had three goals and seven assists in 55 games for Tampa Bay last season. He has 31 goals, 43 assists and 771 penalty minutes in 387 games in seven seasons with Dallas, St. Louis and Tampa Bay.
Gagner went to Tampa Bay in a deal that sent left wing Teddy Purcell to Edmonton.
The 28-year-old Purcell had 12 goals and 30 assists in 81 games last season. In 401 games in seven seasons with Los Angeles and Tampa Bay, he has 75 goals and 153 assists.