Match ends, St. Mirren 1, Dundee 2.
Dundee came from behind to win in Paisley as St Mirren trudged off nursing a sense of injustice.
The excellent Kenny McLean had given the home side a first-half advantage with a stunning strike from 20 yards.
But a controversial goal from an apparently offside Gary Irvine drew Dundee level and a looping effort from Iain Davidson put the visitors ahead.
Late on, St Mirren's Yoann Arquin was shown a second red card in three games after being booked for diving.
The defeat means Gary Teale's second-bottom side remain four points in front of Ross County, who have two games in hand. Dundee are now just a point off the top six.
The Buddies made an explosive start. A Stephen Mallan free-kick picked out Arquin at the back post but his goal-bound header was well saved by Scott Bain.
An even better chance came Arquin's way when he was picked out by a Lewis McLear cross, but the former Ross County forward's volley was stopped by Bain's feet.
Dundee's first real chance came through James McPake's header from a Gary Harkins corner but it was a comfortable save for Mark Ridgers.

Talented midfielder McLean sent the home crowd wild when he took possession midway inside the Dundee half before lashing low into the corner of the net.
Dundee almost replied immediately. Former Buddies player Harkins' shot was arrowing towards the net but Ridgers produced an excellent stop to tip over.
Just after half-time it was almost 2-0 to the home side, McLean this time with a header just over following a Mallan corner.
But when another goal came it went the way of Dundee, and with a large serving of controversy.
St Mirren failed to clear their lines but Irvine looked like he was in an offside position when he fired the ball home from close range.
The sense of injustice among the St Mirren fans deepened when Dundee took the lead. Greg Stewart delivered and Davidson's effort swept beyond the reach of Ridgers.
There would be no shortage of effort from Teale's men as they searched for an equaliser. John McGinn and Marc McAusland both headed over the bar.
But St Mirren's task became a whole lot harder when Arquin was dismissed. The striker went down in the box but referee Steven McLean judged it to be a dive.
Having already been booked, Arquin suffered the same fate as against former club County last weekend, albeit that punishment was reduced to a yellow card on appeal.

Line-ups
St Mirren
Formation 4-4-2
- 12Ridgers
- 2NaismithBooked at 24mins
- 4McAusland
- 6Goodwin
- 22TesselaarSubstituted forBallat 90'minutes
- 31Mallan
- 15ArquinBooked at 80mins
- 32MclearSubstituted forOsbourneat 60'minutes
- 3KellySubstituted forWyldeat 59'minutes
- 7McGinn
- 8McLean
Substitutes
- 11Wylde
- 13Osbourne
- 14Reilly
- 16Ball
- 30Baird
- 34Morgan
- 46Wilks
Dundee
Formation 4-2-3-1
- 12BainBooked at 87mins
- 2Irvine
- 26GadzhalovSubstituted forTankulicat 84'minutes
- 5McPake
- 3Dyer
- 6DavidsonSubstituted forKonradat 90+2'minutes
- 10Thomson
- 18McGowan
- 29HarkinsSubstituted forHarrisat 65'minutes
- 20McAlister
- 15StewartBooked at 74mins
Substitutes
- 1Letheren
- 4Konrad
- 11Ferry
- 16Clarkson
- 21Tankulic
- 33Wighton
- 47Harris
- Referee:
- Steven McLean
- Attendance:
- 4,010
Match Stats
- Possession
- Home44%
- Away56%
- Shots
- Home8
- Away12
- Shots on Target
- Home3
- Away7
- Corners
- Home8
- Away4
- Fouls
- Home9
- Away13
Live Text
Post update
Full Time
Second Half ends, St. Mirren 1, Dundee 2.
Post update
Marc McAusland (St. Mirren) wins a free kick in the attacking half.
Post update
Foul by Luka Tankulic (Dundee).
Post update
Attempt missed. Luka Tankulic (Dundee) right footed shot from outside the box is close, but misses to the right.
Post update
Attempt missed. Greg Stewart (Dundee) right footed shot from the centre of the box is high and wide to the right.
Substitution
Substitution, Dundee. Thomas Konrad replaces Iain Davidson because of an injury.
Substitution
Substitution, St. Mirren. Callum Ball replaces Jeroen Tesselaar.
Booking
Scott Bain (Dundee) is shown the yellow card.
Post update
Kenny McLean (St. Mirren) wins a free kick in the attacking half.
Post update
Foul by James McPake (Dundee).
Post update
Attempt saved. Greg Stewart (Dundee) right footed shot from outside the box is saved in the centre of the goal.
Substitution
Substitution, Dundee. Luka Tankulic replaces Kostadin Gadzhalov because of an injury.
Post update
Kenny McLean (St. Mirren) wins a free kick in the defensive half.
Post update
Foul by Kostadin Gadzhalov (Dundee).
Dismissal
Second yellow card to Yoann Arquin (St. Mirren).
Post update
Yoann Arquin (St. Mirren) has gone down, but that's a dive.
Post update
Corner, Dundee. Conceded by Jim Goodwin.
Post update
Attempt missed. Marc McAusland (St. Mirren) header from the left side of the six yard box is close, but misses to the left following a corner.
Post update
Corner, St. Mirren. Conceded by Gary Irvine.