Nicotine is only distantly related structurally to the vitamin nicotinic acid (aka vitamin B3 or niacin). While nicotinic acid is an intermediate in tobacco's biosynthesis of nicotine, the final nicotine molecule also has an N-methylpyrrolidine ring not present in the vitamin. Nicotinic acid is the active form of vitamin B3, but the amide derivative (nicotinamide, as the parent notes) is also a bioavailable form, as it is converted in the body to nicotinic acid. Nicotinic acid is not named for a direct biological relationship to nicotine, but rather a synthetic chemical relationship. Nicotinic acid was first prepared synthetically by reacting nicotine with nitric acid; it was only later that nicotinic acid was isolated from biological systems, and was eventually found to be essential in the prevention of pellagra.
The physiological effects of nicotine are for the most part not due to its similarity with the vitamin niacin, but because it can bind to and activate a certain type of acetylcholine neuronal receptor: that is to say it mimics a neurotransmitter. Notably, nicotine does not bear much structural similarity to acetylcholine, but its agonist activity at these particular receptors is an identifying property of their type, to the point where they are called nicotinic acetylcholine receptors.