As far as I can tell it's impossible to finish this quest without doing anything illegal. You either have to enter Person A's cellar to find things and get information, which leads to some events that give you access to Person B's house and an item you need to finish the murder case, or you have to enter Person B's locked house.

Also, given the part you just got done with, you already seem to have done some graverobbing. So there ;P