I haven't looked at the source for either of these, but if they allow specifying an install prefix (usually something like
./configure --prefix /opt/pencil-2d) then you could install them in a way that avoids them conflicting.
However, this is likely to be a problem that other people run into too, and it really should be fixed at the root. Pencil is clearly too generic a name. Ideally we should persuade one or both of the projects to use a less generic name. This is something that comes up every now and then, and the best long-term solution is upstream renaming.
If these were packaged for Debian/Ubuntu, they'd have to be modified to have different names (there can only be one
/usr/bin/pencil), and store their data in different places. Other distributions would probably rename them differently, and then we end up with a situation where the applications behave differently on different distributions. This makes it harder for the upstreams to support their users.
So, it sounds like you need to talk to both of them, and get them to come up with less generic names. I suggest filing bugs with both, saying that the can't be co-installed with the other project. If the projects don't have a bug-tracker, mail their development mailing list / contact the authors however they like being contacted.