George Harmon's late strike made it two wins out of two for Ross County in Scottish League Cup Group H.
Jordan White headed County in front in the first half.
However, Callum Smith levelled for Raith shortly after the interval.
With penalties looming, Harmon netted with three minutes of regulation time remaining.
Raith Rovers still lead the group on goal difference but have played one game more than County.