The visitors made a strong start to the game but it was the hosts who opened the scoring courtesy of Ryan Hardie's strike.
Dumbarton levelled when Christian Nade nodded in.
Daniel Harvie gave them the lead before Gregor Buchanan turned the ball in at the back post.
The win ended a three-game losing run for Stevie Aitken's side, but the home side were booed off the pitch as their winless run extended to 12 league and cup matches.
Raith boss Gary Locke made three changes to the side beaten by Hearts in the Scottish Cup in midweek and he saw his team take the lead in controversial fashion.
Mark Stewart looked to have fouled Harvie before crossing for Hardie to score his fifth goal of the season, but referee Mat Northcroft waived away the Dumbarton appeals.
Kevin Curthbert had done well to save efforts from Robert Thomson and Sam Stanton in the first half, but he was well beaten after the break when Nade rose above his marker to head Stanton's cross into the net for an important equaliser.
Referee Northcroft then waived away a strong penalty appeal when Andrew Stirling looked to have been brought down in the box, but the visitors did go in front when Aberdeen loanee Harvie was allowed to run and shoot past Cuthbert from 20 yards.
To compound the home fans' misery, the Raith defence then allowed a Stanton corner to drive right across the box to Buchanan, who made no mistake with an angled shot.
Raith have not won a match since 29 October and they go to Dundee United next week in danger of being dragged towards the relegation zone, while Dumbarton will face St Mirren in confident mood after a thoroughly well deserved win.
Raith Rovers manager Gary Locke: "The second half showed the after effects of the cup ties against Hearts, but we need to look to win our home games and we have to do better than what we produced today.
"Heads went down and there should not have been any reason for that, it was one of those days where we looked tired, but the run is alarming and while we did well against Hearts we have to find the consistency and we cannot go blaming each other.
"It is a tough spell, but at the end of the day you either disappear or come out fighting and we intend to do that."
Dumbarton manager Stevie Aitken: "After 10 minutes [new assistant] Ian [Durrant] turned to me and said 'what am I doing here', but he has made a massive difference in the time he has been at the club and this was a terrific result.
"Ian's presence about the place gives everybody a lift and we are delighted to get somebody with his ability in.
"There is a spell of games coming up that will test us, but if we keep producing performances like that, I am sure we will continue to do well."
Match ends, Raith Rovers 1, Dumbarton 3.
Second Half ends, Raith Rovers 1, Dumbarton 3.
Calum Gallagher (Dumbarton) wins a free kick in the defensive half.
Foul by Ross Callachan (Raith Rovers).
Calum Gallagher (Dumbarton) wins a free kick in the attacking half.
Foul by Rudi Skacel (Raith Rovers).
Hand ball by Stuart Carswell (Dumbarton).
Ross McCrorie (Dumbarton) wins a free kick on the left wing.
Foul by Kyle Benedictus (Raith Rovers).
Substitution, Dumbarton. Tom Lang replaces Andy Stirling.
Attempt saved. Kevin McHattie (Raith Rovers) left footed shot from more than 35 yards is saved in the top centre of the goal.
Attempt missed. Rudi Skacel (Raith Rovers) left footed shot from the centre of the box is high and wide to the left.
Substitution, Dumbarton. Ross McCrorie replaces Samuel Stanton.
Attempt missed. Rudi Skacel (Raith Rovers) right footed shot from outside the box is too high following a set piece situation.
Ryan Stevenson (Raith Rovers) wins a free kick in the attacking half.
Foul by Mark Docherty (Dumbarton).
Corner,  Dumbarton. Conceded by Kevin McHattie.
Substitution, Raith Rovers. Rudi Skacel replaces Jason Thomson.
Foul by Samuel Stanton (Dumbarton).
Jason Thomson (Raith Rovers) wins a free kick on the left wing.
Corner,  Raith Rovers. Conceded by Stuart Carswell.
Attempt blocked. Ross Callachan (Raith Rovers) right footed shot from the centre of the box is blocked.
Substitution, Dumbarton. Calum Gallagher replaces Christian Nade because of an injury.
Substitution, Raith Rovers. Scott Roberts replaces Bobby Barr.
Goal!  Raith Rovers 1, Dumbarton 3. Gregor Buchanan (Dumbarton) right footed shot from the right side of the six yard box to the bottom left corner. Assisted by Andy Stirling with a cross.
Corner,  Dumbarton. Conceded by Jean-Yves Mvoto.
Attempt blocked. Christian Nade (Dumbarton) right footed shot from the centre of the box is blocked.
Substitution, Raith Rovers. Ryan Stevenson replaces Chris Johnston.
Kevin McHattie (Raith Rovers) is shown the yellow card for a bad foul.
Foul by Kevin McHattie (Raith Rovers).
Calum Gallagher (Dumbarton) wins a free kick on the left wing.
Goal!  Raith Rovers 1, Dumbarton 2. Daniel Harvie (Dumbarton) left footed shot from outside the box to the bottom right corner.
Corner,  Dumbarton. Conceded by Jean-Yves Mvoto.
Foul by Ryan Hardie (Raith Rovers).
Gregor Buchanan (Dumbarton) wins a free kick in the defensive half.
Foul by Jason Thomson (Raith Rovers).
Robert Thomson (Dumbarton) wins a free kick in the defensive half.
Attempt saved. Ross Matthews (Raith Rovers) right footed shot from outside the box is saved in the top centre of the goal.
Andy Stirling (Dumbarton) is shown the yellow card.
Goal!  Raith Rovers 1, Dumbarton 1. Christian Nade (Dumbarton) header from the centre of the box to the top right corner.
Dumbarton scored three second-half goals as they beat Raith Rovers and boosted their hopes of avoiding relegation.