According to Subaru's electronic parts catalog, there are 2 different part #'s depending on the year of the STi. 05-07 is a 32540 AA011. 04 is a 31819 AA040.
I'm not exactly sure where the sensor is located-here's a PDF from the repair manual which shows how to replace it, but not where it is on the vehicle. I'm guessing underhood though.
There is also a steering angle sensor for the DCCD that was added on 06-07 models. The part # is 27549 AG001. It looks like it's installed behind the steering wheel, where the clock spring for the SRS is.
It looks like you'll have to find out what year the control unit and tranny are to find the right sensor(s).
Good luck!!
Phil STiDCCDYawSensor.pdf