As others have said, in is correct here and with is not.
Even though, in many other contexts, you can use with to identify what you used to do something, that doesn’t work for vehicles. Similarly, you ride in some types of vehicle (as if they were compartments that move) but on others (as if they were platforms that move). It’s very arbitrary.
If I want to emphasize the mode of transport, I would use by, for example:
Because my car broke down, I got home by bus.
Because of my fear of flying, I crossed the ocean by boat.
“I had to drive by rental car” sounds odd, unlike those examples, but a little less odd than “with a rental car.” I’m not sure why, but maybe it’s because drive-by has another meaning in American English. (It will probably not surprise you that “drive-by shootings” are common here.) A better alternative is to make the car the direct object of drive:
Because my car broke down, I had to drive a rental car home.
This is how I would probably say it. In this context, you could informally say, “I had to drive a rental home,” and let the other person infer that you were driving a rental [car to your] home, not driving a rented home on the street.