Need to hack joystick so I can simulate its input from raspberry pi
There are two obvious ways to do it.


Use a 'digital' potentiometer to replace the resistances of the analog joystick pot. The MCP4331 is one example. It has 4 digital pots and an SPI interface. It comes in a TSSOP surface mount package, so you might want to use a TSSOP to DIP adapter for testing on a breadboard or wiring it by hand.  
Use a DAC (digital to analog converter) to produce a voltage like the original pot did. The MCP4802 has two 8 bit DACs and an SPI interface. It is available in DIP packaging, which may be a bit easier to work with.