I have this 9VDC relay (attachment)the question is:
it's a 5-pin relay... which is output and input?
i've searching for the datasheet, but can't find it anywhere... someone help?
one more question... anyone knows what kind of equivalent component that can substitute transistor MPS6531
The two pins on one side connect to the coil. You can verify that with an ohmmeter; it will measure something over zero ohms. The three pins on the other side are a single pole double throw switch. You can find the normally closed contacts with an ohmmeter. If you don't have one, get one, they are inexpensive.
The two pins at one end is most definitely not the coil connection. Check the pins seperation against the image to see whether it is correct for your relay.
MPS6531 is a 60V 0.6A NPN transistor, for replacement, use BC337A, BC637 or BC639. In case that you use it for driving this relay, then try any general purpose NPN transistor.