Martin made 38 appearances last season for Livi, scoring five goals, as they finished sixth, one place above Rovers.
He was in his second spell with the West Lothian club, with whom he started his career.
Scott went on to play for Ross County and Hibernian, who farmed him back to the Dingwall club on loan.
He switched back to Livingston last summer.
Raith Rovers have signed Martin Scott after the 28-year-old midfielder was released by Scottish Championship rivals Livingston.