Welcome to United Bimmer. The transmission should bolt up. The engines used in the 5 Series was the same as those used in the 3 Series. If the transmission numbers are the same then I don't see why it wouldn't work. How much is the cost of a rebuild? Both will require the engine being removed from the car. With a rebuild the car will be out of service for a longer period of time.