Get Value of Lookup fields
EntityReference entref = (EntityReference)item.Attributes[attributeName];
var LookupId = entref.Id;
var logicalName = entref.LogicalName;
Set Value of Lookup fields
newAccount[attributeName] = new EntityReference(logicalName, LookupId);
Set Null Value of Lookup fields
newAccount[attributeName] = Null;