Defender Dan Casey scored twice as Motherwell won for the first time in eight matches to beat freefalling Dundee on new boss Michael Wimmer's home debut.
The visitors' fifth consecutive Scottish Premiership defeat leaves them four points from safety and just three points off bottom spot.
Casey's first came after 12 minutes when he bulleted in a header from an Andy Halliday corner.
The Irishman was left completely unmarked in the box and should have added a near identical goal just a few minutes later from another set-piece.
Tony Docherty's side struggled to compete in the first half, but a change of formation allowed them greater control in the second period.
They equalised with 11 minutes to play when Simon Murray tapped in his 15th goal of the season, but the game was not level for long.
Motherwell restored their lead six minutes later with centre back Casey volleying in from Harry Paton's cross to complete an unlikely double.