The Marlins announced the deal on Monday.
Gordon garnered his second All-Star Game appearance in his first year with the Marlins in 2015, leading MLB with 205 hits.
Per Rosenthal, there is an option for a sixth year, which could make the contract worth $64 million.
While some contracts break the bank, CBS Sports' Chris Towers doesn't feel that way about this deal:
Chris Towers @CTowersCBS
This is a shockingly, stunningly reasonable contract for Dee Gordon. Decent two days for Miami. https://t.co/Ait9BDDah41/14/2016, 2:13:51 AM
Towers is alluding to Miami's acquisitions of pitcher Wei-Yin Chen and infielder Chris Johnson on Tuesday, making this a busy week for the Marlins.
Gordon is one of the best leadoff hitters in the majors, blending blazing speed with a fantastic ability to put the ball in play. He led MLB with 58 stolen bases, and only Miguel Cabrera bested his .333 batting average.
Add that with a .359 on-base percentage, a career high, and Gordon is the kind of player any team dreams of having atop its lineup.
The 27-year-old also exhibited a reliable glove, committing just six errors on 733 chances last season. He was a vital part of a Marlins defense that ranked third-best in the majors.
Keeping Gordon ensures that his presence leading off will set the table for the slugging Giancarlo Stanton, who has had difficulties staying healthy over the past two years. Gordon could do everything but get himself across home plate. Without Stanton in the lineup, the Marlins struggled to score, ranking 29th in the league with 613 runs.
If Stanton manages to stay in the lineup and Gordon can recreate his 2015 season, the Marlins could be scoring a lot more in 2016.
Stats courtesy of Baseball-Reference.com.