Cardiff may have started out on the front foot, but they fell behind in the 13th minute when Boro's January signing Dyer stabbed home Ishmael Miller's low cross from two yards out.
A debut goal for Ameobi put the hosts 2-0 to the good in the 17th minute, the Newcastle United loanee dancing through the Cardiff defence and curling his shot beyond David Marshall.
Cardiff came agonisingly close to pulling a goal back in the 33rd minute when Boro keeper Jason Steele punched a Bellamy corner into the path of Peter Whittingham, and was forced to redeem himself with an impressive save when the striker went for goal.
Malky Mackay's side pulled one back in the 67th minute when Aron Gunnarsson took advantage of sloppy Boro defending to head home Bellamy's corner.
Cardiff pressed for an equaliser and almost got one when Campbell headed Whittingham's 87th-minute corner over the bar, but Boro clung on for the win.