The Dockers led by 22 points at quarter-time and were still clinging to a slender lead as the clock wound down in Sunday's match in front of 43,882 fans.
Amartey gave Sydney the lead when he out-muscled Brennan Cox in a marking contest before calmly slotting the 20m set shot with 86 seconds remaining.
In a frantic finish, Fremantle surged forward for one final attack with just seconds remaining.
A long kick into attack was marked by Dockers forward Jye Amiss, but the siren had sounded just a second earlier, giving Sydney the 9.14 (68) to 9.11 (65) win.
The result marked Dean Cox's maiden AFL win as Sydney coach and ensured the Swans avoided slipping to a 0-3 record heading into their bye week.
Warner, who is being hotly pursued by Fremantle and West Coast, finished with 26 disposals and 10 inside-50s.
Sydney tagger James Jordon (24 disposals, 10 clearances) nullified the influence of Caleb Serong (19 disposals, five clearances, one goal) in a critical shut-down role.
Jaeger O'Meara (32 possessions) and Nathan O'Driscoll (25) racked up big numbers for Fremantle, while Josh Treacy kicked four goals.
Star Dockers recruit Shai Bolton looked rusty on the way to 15 disposals and four clearances.
Fremantle defender Brandon Walker was subbed off in the second quarter with a left shoulder injury.
The Dockers and the Eagles are 0-2 heading into next Sunday's western derby.
In a pressure-filled opening quarter, Fremantle made the most of their chances by kicking four goals to nil to take a 22-point lead into the first break.
Treacy kicked the first two goals of the match, and fellow bigs Luke Jackson and Patrick Voss also hit the scoreboard as Fremantle flexed their muscle.
Sydney failed to capitalise on a 10-5 advantage at the stoppages on the way to spraying 0.5 for the term.
But they fared much better in the second quarter with three goals.
A bit of midfield magic from Warner allowed Peter Ladhams to kick Sydney's first goal of the match.
And when Warner snared a goal himself later in the term, the margin was just four points as the boos rang around Optus Stadium.
Serong was largely nullified by Jordon in the opening half but managed to pop up for a goal to give Fremantle a nine-point buffer at half-time.
Sydney's stoppage dominance meant Fremantle were forced to defend for prolonged periods in the third quarter.
The Swans hit the lead late in the term, but Bailey Banfield's tough set shot from near the boundary gave Fremantle a two-point edge at the final change.
Sydney surprisingly subbed off ruckman Brodie Grundy 11 minutes into the final term, and Amartey limped off just minutes later with a corked leg.
Amiss scored the first goal of the last term at the 14-minute mark, but mature-age recruit Riley Bice replied a short time later with his maiden AFL goal.
Amartey came back on the field and popped up for the match winner.