* Specific Year and Model: Both the 350Z and Mustang GT came in various years and trims with different horsepower and performance options. A later-model 350Z or a high-performance Mustang GT would likely win.
* Modifications: Aftermarket modifications (exhaust, intake, tuning, etc.) can significantly alter the performance of either car. A heavily modified 350Z could easily outperform a stock Mustang GT, and vice versa.
* Driver Skill: A skilled driver can make a big difference in a race.
* Race Conditions: Track conditions, weather, and even the starting conditions (e.g., uphill vs. downhill) will impact the outcome.
Generally speaking: Stock for stock, a Nissan 350Z (especially later model years) would likely have a slight edge over a base model 2004 Mustang. However, a 2004 Mustang GT might be a different story. The 350Z typically boasts better handling and a more favorable power-to-weight ratio. But it's not a guaranteed win for the 350Z.
To give a definitive answer, we need specific details about the year, model, and modifications of both cars.