It finished 1-15 to 1-14
Dublin have retained the All-Ireland title for the first time since 1977.
A last minute free from Cillian O'Connor failed to reach the target, ensuring that Jim Gavin's charges would secure the Sam Maguire for the second consecutive year and their fourth since 2011.
They looked to have been assured of the honours inside the final minutes but Mayo clawed their way back to within a point but the O'Connor was just outside his range.
Both sides made significant changes to their personnel ahead of the replay with Bernard Brogan and Michael Darragh Macauley demoted to the Dublin bench along with Mayo goalkeeper David Clarke.
But all three were introduced with Dublin profiting the most from the changes. Ron Hennelly started in the sticks ahead of Clarke but was forced off with a black card while Brogan's replacement Paddy Andrews failed to make a major impact on the scoreboard.
Dublin took the half-time initiative by the thread bare margin following a frenetic opening period which produced a flurry of yellow cards and two black cards which robbed both sides of a key defender.
Dublin romped into a 0-04 to 0-00 lead inside the opening minutes with Kevin McManamon and Dean Rock both splitting the posts. Mayo defender Paddy Durkin disrupted that momentum with a score which was followed by three more Mayo points without reply, including two Cillian O'Connor frees.
The reigning champions appeared to have reclaimed the momentum with further points from Dean Rock frees as a result of petulance in the Mayo defence before Lee Keegan broke through the Dublin cover to drill a low shot past Stephen Cluxton.
Keegan was winning the early stages of his tussle with Connolly, minimising his nemesis to just one point from play but a black card shortly before half-time offered Dublin another scoring outlet to devastate Mayo in the second half.
Referee Maurice Deegan also brandished a black card to Dublin defender Jonny Cooper for a challenge on Donal Vaughan while a major fracas just before the break resulting in three yellow cards.
Diarmuid Connolly and Vaughan were the first to receive warnings with John Small taking the last one of the first half although footage showed Small attempt to strike with the elbow after tumbling to the ground with Cillian O'Connor.
Mayo started the second half as they did in the drawn game, hitting the first scores through brothers Cillian and Diarmuid. But then the pivotal moment arrived when a long range pass landed in the Mayo goal mouth and Rob Hennelly fumbled the catch.
Andrews pounced and a panic stricken Hennelly hauled him to the ground resulting in the inevitiable decision of a penalty and Hennelly's agony was compounded by a black card, bringing his All-Ireland to a dismal end.
Clarke was drafted in but after guessing the right side, he mis-timed the leap and the pace of Diarmuid Connoly's shot smashed past Clarke's palm.
The sides traded points over the concluding twenty minutes with Dublin substitutions making a decisive impact. Bernard Brogan and Cormac Costello both pointed