Livingston moved above Raith into fourth after Craig Barr's second-half strike secured a 2-1 victory.
The home side took the lead just before the half-hour mark as Marc McNulty found Iain Russell in the area and the striker slotted into the bottom corner.
But they were pegged back five minutes later as David Smith's corner caused chaos and Brian Graham was on hand to poke home from close range.
Graham was denied a second in the 38th minute as his drive from the edge of the area hit the crossbar.
Four minutes after the break Livingston struck as Jesus Garcia Tena's cross from the left was turned in by Barr from six yards.
Douglas Hill headed over from close range in the 62nd minute as Raith failed to find a leveller.