Both races must have the Alliance tech (difficult if you have tech trading turned off, as the AI doesn't tend to research it very early), and relations must be Close.
A research treaty "gives" the civ you give it to 10% of your civ-wide research output. It is however not subtracted from yours. (Economic treaties work in a similar fashion.)