Turn a tag field id into an instance of the tag model
You need to get the FieldModel using the $tagFieldId variable, and then pass that model into the function as follows:

$tagFieldRecord = FieldRecord::model()-&gt;findById($tagFieldId);

$tagFieldModel = FieldModel::populateModel($tagFieldRecord);

craft()-&gt;relations-&gt;saveRelations($tagFieldModel, $entryRecord['elementId'], $tags);