Cardiff had the chance to salvage a draw in the last minute, but fly-half Nick MacLeod couldn't convert Robin Sowden-Taylor's try. Thomas kicked four penalty goals and a superb conversion to push Cardiff into the relegation zone with only three games left to play.
The famous Arms Park side are joined in the bottom three by the equally famous Llanelli club, who could manage only a 17-all draw at Newbridge. The other side in the mix are Llandovery, who lost 22-47 to Pontypool. One team will drop to Division One at the end of the season.
Aberavon hooker Jason Hyatt returned from an 11-month absence in the Wizards' match against Pontypridd at Sardis Road, but his much-awaited comeback lasted barely 30 minutes as he was red-carded for punching in the home side's 54-19 mauling.
Centre Lloyd Warner scored a second-half hat-trick of tries in the win, which extends Pontypridd's lead over Aberavon to five points in the race for third place in the Premier Division.
Cross Keys continued their fine season with a 26-15 victory over Swansea on the back of two tries to centre Gareth Chapman and 16 points from the boot of Darren Miles. Bedwas beat Bridgend 23-15 on the back of some fine kicking from Andrew James, and Carmarthen Quins scored three tries in their 24-18 win over Ebbw Vale at Eugene Cross Park.
In the late kick-off Newport beat Neath 32-27.
Results: Bedwas 23 Bridgend 15, Caerphilly 27 Cardiff 25, Cross Keys 26 Swansea 15, Ebbw Vale 18 Carmarthen Quins 24, Newbridge 17 Llanelli 17, Pontypool 47 Llandovery 22, Pontypridd 54 Aberavon 19.