The Lions dominated the clash and O'Brien gave them a deserved victory in the 73rd minute when he tucked home a loose ball in the penalty area.
His goal ended a run of six straight clean sheets for Leeds, who finished with 10 men after defender Pontus Jansson went off injured with all three substitutes on the pitch.
Cardiff are level on points with Thomas Christiansen's side after Sol Bamba netted a 95th-minute equaliser to nick a 1-1 draw against Sheffield Wednesday.
The visitors had looked on course for a third straight win following Gary Hooper's opener just before the break but they were denied at the death.Wolves moved above the Bluebirds on goal difference courtesy of Diogo Jota's double in a 2-1 victory at Nottingham Forest.
The Portuguese midfielder opened the scoring two minutes after half-time and then netted an 81st-minute winner after Mustapha Carayol had drawn Forest level.