Yes and no. It depends on several things which is why it’s good to call the veterinarian’s office first and at least touch base.
Most medications are dosed by weight, so first, you have to make sure you are giving the right dose. It’s not always as simple as doubling or cutting in half.
Next, you have to make sure it’s really the right use of the medication. Sometimes, what looks similar is actually a different illness and needs a different medication. Some patients are allergic to medications. Some medications in combination can cause a horrible interaction.
Therefore, it’s best not to self-diagnose and check in with your veterinarian that your re-purposed medicine is being used properly for the new patient.