Trailing by 27 points late in the third quarter, the Dockers kicked the last six goals of their preliminary final to win 12.11 (83) to 10.11 (71) at the SCG.
Fremantle advance to the second grand final in club history, where they will meet either Hawthorn or Brisbane.
Justin Longmuir's men were staring down the barrel of an early exit before Hayden Young converted a difficult set shot after the three-quarter time siren, and were full of running in a gripping finish.
Young (28 disposals), Andrew Brayshaw (29), Caleb Serong (28) and Shai Bolton (two goals) were instrumental in the victory.
But it wasn't assured until the dying stages, when Isaiah Dudley ran into an open goal with less than two minutes on the clock.
Luke Jackson also finished with two goals in an entertaining ruck battle with Brodie Grundy.
Dudley's second major was the Dockers' fifth of a dominant final quarter, in which Patrick Voss's huge fend-off and checkside goal on the run was a highlight.
Sydney's brave effort came without injured captain Callum Mills and the five stars banned in the fallout from the Pullman Hotel scandal.
Errol Gulden (36 disposals) was brilliant in setting up their lead, with Logan McDonald (three goals) dangerous in attack.
A rare Gulden error by foot gifted Neil Erasmus the opening goal and Fremantle kicked the first two, but it was the Swans who settled best in front of a sell-out crowd of 45,129 fans.
Sydney kicked the next four majors to lead 4.5 to 2.1 at quarter-time as their intense pressure and intercept game overwhelmed the visitors early.
Tom Papley's snap was a highlight, and while the Dockers had early chances in the second term, it was McDonald who bobbed up with his second to extend the Swans' margin to 21 points.
Fremantle eventually broke their goal drought through a fortunate free kick to Michael Frederick, but were rebuffed each time they edged closer in the second term, with the Swans holding a 7.6 to 4.5 buffer at the main break.
Goals to Jye Amiss and Jackson dragged the Dockers back within eight points early in the third term, but again it was the Swans' elite pressure that led to a steadier through Angus Sheldrick.
Further goals to McDonald and Charlie Curnow gave the home side a significant 27-point buffer and it became an arm-wrestle, which suited the Swans, though Papley struggled with a sore knee after a collision with Karl Worner.
All hope looked lost for Fremantle before Young's goal after the three-quarter time siren breathed life into the contest.
Ineffective earlier, Bolton and Voss inspired their side with team-lifting goals early in the final quarter and the Dockers wouldn't be denied.