For comparing to 5 commit to the current one, both on master, just simply do:
git diff master~5:pom.xml master:pom.xml
Also you can refer to commit hash number, for example if the hash number is x110bd64, you can do something like this to see the difference:
git diff x110bd64 pom.xml