If it has compiled code in the package, you need to rebuild it in most cases.
Short summary on how to do that:
To do that, download the source package on Ubuntu 14.04 or 14.10 (whichever you meant by "Ubuntu 14") with
apt-get source -d packagename and copy the downloaded files, one
.dsc and usually one
.debian.tar.gz (sometimes still a
.diff.gz) and usually one
.orig.tar.gz onto the machine with the older Ubuntu release (I assume Ubuntu 12.04 since 12.10 is no more supported).
There, unpack the source package with
dpkg-source -x file.dsc (as the following tools from the
dpkg-dev package) on the copied
.dsc file and change to the created directory.
Then check if you have all build dependencies installed with
dpkg-checkbuilddeps, install the missing ones if necessary.
dch --bpo to add a proper changelog entry and version number depending on how proper the backport should be.
dpkg-buildpackage -b to rebuild the package.