I don't believe meds count toward the restriction. I think baby food/formula as well as medicine with a script are exempt from the rule.
I found this:
Medications Allowed
All prescription and over-the-counter medications may be brought aboard an aircraft in a carry-on bag, according to the TSA website. Liquid, gel and aerosol medications do not have to fit in a passenger's single quart-size bag and are exempt from the 3 oz.-rule. Other medications, including pills and inhalers, are permitted through the TSA screening checkpoint. The quantity of all medications you bring through the checkpoint should be reasonable for the length of the flight or travel period.
Packing Tips
Label all medications bottles and containers to help TSA officers during the screening process. Liquid, gel and aerosol medications that do not fit in a quart-sized bag or are larger than 3.4 oz. may not be placed with other liquid items in a carry-on bag. When packing, store all medications in a single, easy-to-access location. These items must must be screened separately from other passenger items.
Screening Process
Declare all liquid, gel and aerosol medications, either orally or in writing, to the TSA agent at the security checkpoint. Prescription medications are typically X-ray screened, though visual inspection is available upon request. Because TSA officers do not handle personal medications, display all medications for the security officer as prompted during a visual inspection. After the visual inspection, medications that are difficult to screen still must pass through the X-ray scanner before you can bring them on the plane.
Additional Considerations
The TSA allows water, juice, liquid feeding supplements and non-prescription items, such as saline solution, eye drops or petroleum jelly. to pass through the checkpoint when they are medically necessary. Pack prescription medications that must stay cold with gel or ice packs that are frozen solid. Packs that have begun to melt must meet the TSA's 3-1-1 regulations.