My original mouse hack was like this. Ground is usually obvious. Then I just trial and errors the others until it worked.
BTW, in that second pic you are highlighting the emitter pins. You want the other set of pins

It is odd the emitter is 4 pin, usually those are just a led.
Looking at the right pins at initial top and bottom pics you provided I;d say the right pins (when looking at the bottom side pic) are power (?) and ground. the other two are data.
Though, you don't need to know this at all. Find the IC at
http://www.datasheetarchive.com/ and figure out which pins are x+, x-, y+, and x-. The rest should be obvious.