In Mercurial, one can define a pattern for external diff and merge tools (so that they are called only for files matching the pattern specified):
[diff-patterns]
You would use a merge driver in a gitattributes file.
See for instance "How do I tell git to always select my local version for conflicted merges on a specific file?"
*.ext merge=mymergetool
You can use patterns in a gitattributes file.