Fletcher and Burnley were buoyed by the goal and the Scotland striker almost got a second only to chest down a cross and see his scuffed shot come back off the post.
The Dundee defence were able to block Margiotta first shot from inside the area but the rebound favoured the strikerand his second attempt beat Speroni.
Thompson made it 3-1 in the 56th minute when he was on the end of a driven cross by Oran Kearney, and the striker added a second two minutes later following good work by Murphy.