Dundee made one change to the team with Zach Robinson replacing Paul McMullan who is on the bench.
Dundee attacked from the start and Luke McCowan had a shot blocked in the first minute, Dundee kept up the pressure and forced a few corners. Josh Mulligan headed into the side netting from a Hannant cross as Dundee continued to threaten.
Dundee then had a flat spell but never troubled by Raith when they did attack, but on 29 minutes Dundee scored the vital first goal. Following a throw on the right Mulligan found Zach Robinson who swapped passes with bewildering speed with Alex Jakubiak, before running clear to poke the ball past the advancing keeper and into the net.
Dundee looked well in control now and could have added more before half time with both Hannant and Robinson efforts on the goal.
The second half started the same with Dundee on the attack, they got the second goal on 52 minutes when Luke McCowan flighted a lovely teasing cross from the right into the goalmouth. The defence seemed to think it would sail harmlessly through to the keeper, but Zach Robinson nipped in to turn the ball home for number two.
Dundee still attacked and got the killer third goal on 75 minutes when Marshall and Hannant combined on the left. Hannant’s pass sent Cameron to the byline where he cut the ball back for Alex Jakubiak to smash a low shot into the net from seven yards.
Just two minutes later Raith pulled a goal back when Akio netted from close range, the good thing is it never troubled Dundee or the final scoreline.
Dundee played well enough in the wind and rain to win a vital match in the run in. Next up is Morton at Dens on Saturday.
Dundee: Legzdins, Mulligan, Ashcroft, Sweeney (c), Marshall, McCowan (Reedy 86), McGhee (Maguire 90+1), Cameron (Byrne 86) , Hannant, Jakubiak (Thomas 84), Robinson (McMullan 84). Unused Subs: Lawlor (gk), Williamson, Fisher, Clampin.
Referee: Greg Aitken
Att: 5,009