Two teens (boys?) find some kind of numbered cubes - possibly from a scientist's lab - which when squeezed allow them to enter the mind of someone else, which is represented by a house. In the house the person's true self is locked inside a room and they set him free. Published before 1990. Thanks!