It also depends on the gear ratios. The gears (and the wheels) determine the torque which is transfered to the street. Bigger wheels/longer gears mean more torque is needed to accelerate at a certain rate. Considering the weight, if I recall correctly there was some formula that states F = m*a. So the force is equal to mass times acceleration, which means a = F / m. So acceleration equals the amount of force divided by the mass of the object you are trying to accelerate. Now this is hugely simplified ofcourse, not taking into account tyre grip issues and all that stuff.
Why this gear ratio stuff? Well thats the reason a diesel engine with X torque will never accelerate as well as a petrol engine with X torque. Because the rev range of the petrol engine is bigger you will be running in lower gears for the same speed in the petrol engine one, giving you extra acceleration potential. Of course when magazines compare accelerations in-gear at a certain speed usually the diesel is faster, but thats just because those tests are usually done in "petrol-unfriendly" ranges. (imagine doing an acceleration test from 50-80mph with the Z in 6th gear .... )
So, supposed you have the same car, the same weight, the same gearbox etc. And you put in an engine which gives high torque from 3000-6000 rpm, redlining at 7k rpm, or you put a diesel engine with the same amount of torque but which gives it from 2000-3500 rpm, redlining at 4.5k rpm the petrol one will be faster.
I drove a friend's A3 once, 170hp and approx. the same torque as the Z, but i spent more time changing gears than accelerating it, 2000 rpm of powerband really isnt that much