They both have at least 1 square face.
What is the same about a pyramid/cube/rectangular prism.
How many flat faces does a triangle prism have?
Five faces.