Goals from Peter Odemwingie and Cox opened up a two-goal lead just after the half-hour, only for a City side showing 10 changes to be level after 50 minutes courtesy of former Albion striker Robert Earnshaw and substitute Joe Mason.
It was Republic of Ireland striker Cox, though, with only one goal this season and that back in August, who had the final say with a 25-yard strike on the hour and a tap in at the death.
It was undoubtedly clear Bluebirds boss Malky Mackay had Tuesday's Carling Cup semi-final first leg clash at Crystal Palace higher on his agenda with seven players were rested.
There appeared to be a hint of good fortune about the Baggies' opener after seven minutes, although the fact referee Lee Probert ignored strong penalty appeals shortly beforehand seemingly evened up the score.
James Morrison produced a surging run to the deadball line, with his cut-back clearly hitting the hand of a sliding Dekel Keinan.
The argument from Probert appeared to be it was one of those Keinan - this week recalled from a loan spell with Palace - was unable to avoid.
Three minutes later, however, and Albion had their opener courtesy of Odemwingie's fifth goal of the season, and his third in his last five appearances.
Goalkeeper Tom Heaton's booted clearance landed at the feet of Craig Dawson in the centre circle, the midfielder delivering a first-time punt back up the field for Odemwingie.
Although he appeared to be a good few yards offside, there was no flag, allowing him to bury an 18-yard effort beyond Heaton.
The visitors then proceeded to dominate possession, albeit without testing goalkeeper Ben Foster and putting the Baggies backline under any undue pressure.
Indeed, when the second goal came the game was flatlining at that stage and in need of a spark, which duly arrived from Cox.
Initially, it was a powerful run from Cox that resulted in a foul from Keinan 12 yards outside the area.
From the free-kick, again there was a touch of good fortune for the home side as Probert ordered a re-take and booked captain Nicky Shorey for not playing to the whistle.
Shorey's initial effort had gone out of play, but second time of asking he delivered a precision ball into the heart of the area for Cox to head home from eight yards his first goal since August 23.
Three minutes later, though, it was an error by Shorey that allowed City a lifeline, with Filip Kiss on hand to take advantage and supply a simple ball into the six-yard box for Earnshaw to tap beyond Foster.
A superb Heaton save a minute later prevented Albion from restoring their two-goal cushion, which instead was eroded five minutes after the break.
Earnshaw was the supplier. Turning on the pass, 42nd-minute substitute Mason beat Foster in off his right-hand post with a low angled strike.
After Shorey hit the crossbar from 20 yards soon after, Cox doubled his tally in the 61st minute with a sizzler from 25 yards that gave Heaton no chance as it crossed the line after rattling off his right-hand upright.
Morrison should then have sealed matters in the 78th minute, but in a congested penalty area and after doing the hard work in rounding Heaton, from two yards out he sliced his shot into the sidenetting.
It was Cox who sealed matters right on 90 minutes, tapping home his hat-trick strike inside the six-yard box after being teed up by Odemwingie.