I suspect that your problem is internal rather than linkage but somebody who knows more about it than I might want to chime in about that.
A 365 will fit in your frame, but they are rare and I believe spare parts for it are too. Certainly the 5th speed gear, which was made by Hewland, has not been made for more than forty years.
I would advise that you get an NG3. They are more current and Andy Harwood, with some judicious pounding on the rear hoop, was able to install his in his 352/365 frame. I replaced my rear hoop because it didn't seem like it would fit but maybe I didn't try hard enough. In any case, Richard at Banks sells kits and he'll be happy to advise you.
One difficulty will be the shift linkage. There are two ways to go - the linkage that Richard will sell you with the tranny or a cable shift arrangement. I think the engine will have to come out in order to attach the bracket for the "pivot cross." I'm not sure what or how much is required to implement a cable shifter. Somebody here or maybe even Richard might be able to advise you.
Good luck!