The midfielder drilled the crucial winner into the bottom-right corner after 92 minutes of play at New St Mirren Park to give his side only their second SPL victory of the season, their first since beating Hibernian in August.
Marc McAusland had opened the scoring for the hosts in the first half but his effort was cancelled out by Aberdeen's Rory McArdle just before the hour, and the teams seemed set to have to settle for a point apiece until the dramatic finish.
St Mirren manager Danny Lennon made two changes as the basement side hosted Aberdeen in the SPL.
Midfielder Aaron Mooy made his first start, following his debut from the bench in the previous week's 3-0 defeat at Hearts, while David van Zanten also started, the pair taking to the pitch in place of the benched Hugh Murray and Kenny McLean.
Aberdeen manager Mark McGhee named the same team which last weekend earned his club's first league victory in six games, the 4-2 home win against Hibs.
Yoann Folly was in the starting line-up after recovering from the ankle injury which had kept him out of the Pittodrie side's injury-time League Cup quarter-final victory over Falkirk in midweek.
Van Zanten had an early shot from the edge of the area which hit off Mooy, but the home defender then earned his side's first corner on five minutes by weaving his way past Paul Hartley and into the box.
Aberdeen had been passing well and had a chance on 10 minutes following a free-kick from Sone Aluko, but Chris Maguire put his final effort over the bar from beside the right-hand post.
Van Zanten had a speculative effort easily saved by Mark Howard, and Gareth Wardlaw then went down on the edge of box after a clash as he and the visiting defenders pursued Michael Higdon's lay-off from a good move begun by Mooy.
Higdon missed St Mirren's best chance to date on 25 minutes - Mooy and Paul McGowan linked to put him in prime position 12 yards out following a Van Zanten throw on the right, but the home striker lifted his effort over the crossbar.
Aberdeen immediately raced to the opposite end, but Scott Vernon stumbled as he aimed to meet Darren Mackie's pass across the box.
However, St Mirren were in front on 29 minutes - Mooy's corner from the right sailed through the box to reach McAusland at the opposite post, and his acute-angled header beat goalkeeper Howard and the defenders on the line to go in at the far post.
St Mirren dominated the remainder of the first half and the lively Mooy even tried his luck with a long-range shot from midfield, which went harmlessly over the bar.
Folly and Ifil combined on the right late in the half for the latter to cross into the box, but the ball proved beyond the reach of the jumping Mackie.
The second half got off to a bizarre start when St Mirren headed straight upfield from kick-off and were initially awarded a free-kick inside the box - but referee Crawford Allan then changed his decision to a drop ball and Aberdeen booted the danger clear.
The visitors responded with a Paul Hartley corner from the right and Maguire met the clearance at the edge of the box but fired wildly high.
Mooy then had a free-kick from the left wing, awarded when Travner was brought down by Ifil, easily claimed by Howard in a lively opening spell.
Zander Diamond had to be alert to meet a cross and head it away from Higdon inside the six-yard box after an excellent St Mirren break upfield on 56 minutes.
However, Aberdeen levelled moments later after being awarded a free kick on the right byline after a foul on Maguire.
Hartley drilled in the set piece and although Maguire took a fresh-air swipe at the ball, it fell to defender McArdle who powered a sweet finish into the bottom right corner.
McGowan held the ball up well near the corner as the game entered its final quarter to allow Travner to take possession and work his way along the byline, but Ryan Jack blocked his run at the near post.
Folly forced Craig Samson into a save when he found space to approach goal after gathering a Hartley corner at the second attempt and running in from the left.
Wardlaw put a turn and shot from 18 yards over the bar with quarter of an hour remaining as both sides searched for a crucial winner.
McGowan came close with a long-range half-volley which went only narrowly off target.
Hartley blazed over the bar after a Michael Paton corner five minutes from time, while Travner saw a diagonal free-kick from just outside the penalty area whistle past the left-hand post in an end-to-end finish.
However, the on-loan Watford midfielder netted a dramatic winner two minutes into injury time, skipping past substitute Paton at the left byline and rolling home a drilled finish which nestled in the opposite corner.