Raith's promotion hopes ended as Colin McMenamin's stoppage-time strike gave Queen of the South a 1-0 win at Stark's Park.
McMenamin scored his 10th league goal of the season three minutes into added time, meeting Stephen Black's cross to convert from close range.
In a disappointing opening half Rovers' best effort came after 19 minutes, John Baird's effort from inside the box hitting the crossbar.
McMenamin then fired over from 18 yards four minutes before half-time.
Baird and Craig Wilson both fired wide from the edge of the area in the second period for the home side, while Robert Harris' 25-yard free-kick wide was the best Queen of the South could muster after the break until McMenamin snatched all three points.
Dunfermline`s victory at Morton ensured they are crowned champions with one game remaining.