The deal was reported earlier Wednesday by Fox Sports. Gordon's extension also includes a sixth-year vesting option worth $14 million, according to Fox Sports. The extension will cover Gordon's final three years of arbitration and his first two years of free agency.
Gordon, 27, won the National League batting title last season, batting .333, and also had a league-leading 58 stolen bases. It marked the second straight season that Gordon led the NL in steals.
Gordon also led the league with 205 hits last season and scored 88 runs in his first season with the Marlins, who acquired him in a trade with the Los Angeles Dodgers.
Gordon is the son of former major league pitcher Tom Gordon. A two-time All-Star, Dee Gordon has played parts of five seasons with the Marlins and Dodgers, batting .293 with 188 stolen bases.