Dundee United claimed a 2-1 victory over Inverness Caley at Tannadice in a lively Scottish Premiership encounter.