The visitors struck first through Craig Conway and led at the break, but Richie Bennett levelled for the hosts with 17 minutes remaining.
However, Danny Graham won it for Rovers with the last kick of the game at the Furness Building Society Stadium.
After a disappointing end to last season in which the Bluebirds missed out on the play-offs, finishing seventh, boss Cox was encouraged with his side's first pre-season run out.
He told the club's website: "You look at the quality we played against today, big thank you to Tony (Mowbray, manager), he's brought his first team squad down.
"Fitness levels looked really good and the lads looked structured and organised. I think the whole game was a real positive for how early it is in pre-season.
"Sometimes I contradict myself because results always matter and we've lost a game, but you have to see beyond that.
"I can't fault any of the players who went out there. It was 25-30 degrees against a very good side, who I'm sure will be successful this season. I think the whole 90 minutes was really positive.
"We have a very important game on Tuesday now where we'll test ourselves against a full strength Motherwell side."