It gets even more complicated than this - the gene could be identical in sequence and still have a different function because of a change somewhere else in the genome. The genome is the ultimate spaghetti code that is the result of 3.5 billions years of hacks upon hacks upon hacks.