They are two different kinds of car for two different kinds of driving.
There is no way to generalize on which is faster, because it depends too much on individual specifics. A Plymouth Road Runner Hemi will smoke a Miata, but what do you expect? A Bugatti Veyron will run away from a Hemi Barracuda like it was anchored to the road, but again, what do your expect.
A muscle car is almost exclusively American (although some late model German and Japanese cars now fit the criteria).
It was originally the lightest sedan or two-door (coupe) in the model range with minimum luxury options, but the biggest honking V8 they can stuff in, backed by a floor shift manual transmission (exceptions being the Mo-pars with TorqueFlite automatics).
They are primarily for making noise and cruising to the drive-in, and for occasional street racing and for the serious, NHRA and AHRA sanctioned drag races on the quarter mile strip.
Suspensions on the original muscle cars were primitive and brakes were minimal, so going around corners or strafing apexes on winding roads was not much fun.
A sports car is intended to provide recreation in driving the open road.
The ideal sports car is characterized by balance, rather than brute force. The idea is to be able to carry as much speed into a corner as possible, brake as late as possible, and accelerate out smoothly so as not to lose speed and upset the balance of the car for entry into the next corner. In a race track with multiple corners and elevation changes, a sports car will leave a muscle car in its dust.
In a banzai run, where top speed is all, a sports car with equal horsepower will run away from a muscle car, because they are lighter, and have smaller frontal area and lower drag coefficient, for less aerodynamic drag, and muscle cars are usually geared to run out of rpms at the end of a quarter mile.
A good example of a fair match-up between a Muscle car and a sports car now would be a C-6 Corvette versus the new Camaro SS. They have virtually identical engines and transmissions, but the Corvette weighs 643 pound less, sits 5.2 inches lower, and is aerodynamically slicker. You tell me which would win. It's not rocket science.
A BMW Z4 is not a high-power sports car like the Corvette, though. The base model has a power to weight ratio about half that of a Corvette, so you will not be winning many drag races. It is however, a well-balanced and willing partner for driving winding roads, with excellent brakes and sticky suspension and tires.
As for horsepower v torque, you can't have one without the other. Torque is what starts you moving, and horsepower is what keeps you going once you've accelerated. Torque determines pulling power, as when pulling a boat trailer out of the water, but horsepower determines if you'll be able to maintain the speed limit climbing a grade.
In a drag race, torque will win the first hundred yards or so, but horsepower will determine which vehicle has the highest trap speed.
Your Ford Mustang GT (if it's a recent model) will kick his booty.