Greig Spence scored a hat-trick as Raith edged out Cowdenbeath 4-3 in a seven-goal thriller.
Spence put Raith ahead from close range in the third minute, only to see Jordan Morton equalise five minutes later from 18 yards.
The visitors retook the lead in the 26th minute when Joseph Cardle rolled into an empty net, before Kenneth Adamson pulled the hosts level again on the stroke of half-time with a 20-yard effort.
Cowdenbeath hit the front for the first time midway through the second half when Greg Stewart converted at the back post.
Spence had the last word, though. He scored two penalties in the last 10 minutes to give Raith their first win over the season.