Karel Pilar also scored for the Marlies (32-38-2-5), who snapped a three game losing streak.
Michael Ryan, with two, and Kamil Kreps replied for Rochester (45-30-1-1), which has lost two in a row.
Playing before a crowd of 2,950, the Marlies took the first lead of the game at 1:18 of the first period on Earl's 10th goal of the season. The Americans tied it at 15:28 after a defensive breakdown led to Ryan's first marker of the night and 25th of the year.
Earl scored again, this time on the power play at 17:16 of the first, and Toronto led 2-1 heading into the first intermission. But the Americans stormed back in the second thanks to Ryan's second of the game at 8:12 and Kreps' power-play goal at 15:02, and Rochester had a 3-2 advantage after 40 minutes of play.
Pilar scored the Marlies' second power-play goal of the game to pull Toronto even 1:00 into the third. After overtime failed to decide a victor, Earl scored the only goal of the shootout and Toronto goalie Justin Pogge stopped all five Americans shooters to cinch the win.
Toronto was 2-for-6 on the power play, while the Americans were 1-for-5 with the extra man.
Pogge stopped 20 shots to improve to 17-24-2. Craig Anderson (21-10-1) made 36 saves for Rochester.