Swansea had beaten the Bluebirds on their own turf back in November but Bellamy was on target to fire his hometown club to victory with a 25-yard strike in the 85th minute at the Liberty Stadium on Sunday.
The result lifted Dave Jones' men above their rivals and into third spot in the Championship table.
Swans boss Brendan Rodgers named an unchanged side and kept faith with the same starting line-up that won at Bristol City in midweek.
That meant midfielder Leon Britton played his first game at home since returning from Sheffield United while defender Alan Tate retained the captaincy in the absence of Garry Monk.
Dekel Keinan came into the Cardiff side to make his debut and replaced Lee Naylor, with Kevin McNaughton reverting to left-back.
Striker Michael Chopra returned to the Bluebirds side.
The first chance of the game fell to Chopra's fellow frontman Jay Bothroyd, who missed the target from 12 yards inside the opening minute.
Moments later Swansea midfielder Darren Pratley fired goalwards from the edge of the penalty box.
However, his effort was blocked by Keinan and Tate then headed over a free-kick by Mark Gower.
Cardiff went close in the 11th minute when Aaron Ramsey hit a right-foot shot from 20 yards which was parried by Dorus De Vries as the visitors signalled their attacking threat.
Bellamy was also showing his quality with a series of marauding runs. Swansea also threatened when Scott Sinclair cut in from the left but failed to get his shot on target.
Shortly before the half-hour mark, the former Chelsea youngster latched onto Gower's pass but, as he charged down on Tom Heaton's goal, Mark Hudson made a vital challenge to avert the danger.
Pratley also shot over before Bothroyd became the first player to be booked for a late challenge on Tate shortly before half-time.
Cardiff made a change at the back for the start of the second half as Darcy Blake replaced Kevin McNaughton after the full-back picked up a knock just before half-time.
Gower fired the Swans' first attempt of the second period wide of goal before Cardiff twice came close in quick succession.
In the 59th minute, a cross from Peter Whittingham was headed wide by Paul Quinn and Blake then fired against a post from 12 yards with a left-foot shot.
Sinclair then fired over the bar at the other end before both sides made tactical switches, with Craig Beattie replacing Moore and Chris Burke taking Whittingham's place in the 66th minute.
Sinclair continued to threaten for Swansea but he missed the target from six yards in the 80th minute.
And Bellamy made the hosts pay in the 85th minute when he collected a pass from Ramsey and fired a right-footed shot into the bottom corner from 25 yards to settle the match.