Thank you, LDH. I was looking at engines, then told to enter my vehicle info after which it said an 2004 engine was not compatible with my 2007. Double checking. Thanks again!
If you want some added assurance, do a P/N check of the ECU for the two years.
They should be the same.
Also. The 07 has a catalytic converter in the base of the Y Tube ahead of the twin exhaust cans, and the 04 doesn't. But neither have any electronics or sensors on the entire exhaust system, and the headers, Y tubes and cans are all interchangeable on an independent basis (as in full mix or match interchangeability).