If you are using a repository, or if multiple compiled versions of your app are acceptable, then your best bet is to compile your app twice, once with libmemcached5 and once with libmemcached6, and package them separately, with different package names, and use a virtual package to install the right one automatically:
Package: myapplication-memchched5
Version: 1.3.17-1
Depends: libmemcached5
Provides: myapplication
Conflicts: myapplication
Replaces: myapplication
and
Package: myapplication-memchched6
Version: 1.3.17-1
Depends: libmemcached6
Provides: myapplication
Conflicts: myapplication
Replaces: myapplication
Now aptitude install myapplication
will automatically select either myapplication-memchched5
or myapplication-memchched6
based on what else needs to be installed.