Dundee made one change when Cameron Congreve took the place of the suspended Yan Dhandi after impressing as a substitute against Motherwell.
Livingston started well and Jon McCracken made two routine saves, when first he pushed a shot round the post. From the corner it was a straight shot.
After this Dundee settled and played some good football, going down each wing to create chance whhich Livi managed to clear with a bit of luck.
Livingston only had one more chance but again McCracken saved the shot from Muirhead. On the 43rd minuted Dundee took a deserved lead when good work from Congreve to race into space down the right and sent a fast low pass across goal for Simon Murray to smack the ball home at the far post.
Dundee started the second half well and just lacked the final ball to the get the vital second goal. After 64 minutes Congreve picked up a misplaced pass on the halfway line. He ran into space created by Murray’s run to distract the defence and cut inside onto his left foot to shoot. Keeper Prior pulled off a superb save at the expense of a corner.
Two minutes late it was 2-0 when a good ball from Finlay Robertson and this send Cameron Congreve clear and his back post ball was knocked into the net by Joe Westley for his first goal for the club.
Dundee continued to threaten and looked sure to go on and take the three points comfortably. However, Livingston made three substitutions and livened up. The Dark Blues were coping with the attempted fight back but an unfortunate own goal by Clark Robertson transformed the game. A low cross struck his shin and flew past McCracken.
Callum Jones had already come on for Tony Yogane and straight after the goal Emile Acquah, Ashley Hay and Imari Samuels replacle Simon Murray, Joe Westley and Cameron Congreve.
Dundee were under pressure as Livingston went looking for a second goal. They got it from the penalty spot after Clark Robertson made which looked a fair tackle in the box, Bokila scored with ease and now it was 2-2.
The game went from end to end as both teams looked for a winner. Ashley hay headed over when maybe he should have done better. Livingston raced down the park and McCracken pulled off a great save and Ryan Astley cleared the ball off the line.
Perhaps Livingston lost their concentration at the miss because they were wide open when Dundee broke at pace. Reilly ran into the penalty area and was tripped by Danny Wilson. Referee Ross Hardie immediately pointed to the spot. Livingston delayed the spot kick while a player was treated for injury in the penalty area. When Callum Jones was about to take the penalty the referee was belatedly called to the VAR monitor to review his decision.
After three minutes and the referee stuck to his decision and pointed to the spot. Up stepped Callum Jones to score sending the keeper the wrong way to the send the Dundee fans wild. After this the referee played for a minute to finally end the game.
Great three points for the club, and sets up a visit to St Mirren next Saturday which will be a test.
Dundee: McCracken, Wright, Astley, C Robertson, Graham, F Robertson (Reilly 89), Hamilton, Congreve (Samuels 76), Westley (Hay 76), Yogane (Jones 71), Murray (c) (Acquah 76). Unused Subs: Carson (gk), Ingram, Koumetio, Galabov.
Referee: Ross Hardie.
Att: 5,108