Either is possible. Gout with accompanying hyperuricemia can cause kidney disease (uric acid nephropathy). It can also be due to kidney disease, as a decline in kidney function is often associated with increased uric acid levels. Anyone with gout should have there kidney function checked regularly. A nephrologist is usually skilled to detect which is the primary disorder.
Gout and CKD. Gout may be an independent risk factor for CKD and CKD can result in increased uric acid see http://www.ncbi.nlm.nih.gov/pubmed/23543594 http://www.clinicaladvisor.com/gout-management-in-patients-with-ckd/article/315693/