The air conditioning compressor running for a few minutes, stopping for a few, rinse and repeat sounds like normal operation: phase-change cooling is all-or-nothing, the compressor turns on until room temperature gets below set point, then stops until it crosses the hot threshold and turns on again. Since the compressor motor is initially in a stalled condition, it draws a substantial inrush spike and you get a momentary AC voltage dip.
If your computer shuts down when the compressor kicks in, it may be because your UPS' transfer time is too slow for your PSU, your PSU has poor compatibility with the UPS' output waveform, the UPS' battery is in sub-par shape, the UPS is under-sized for the load you are putting on it or the UPS is defective.
As velocity wrote, it is also possible that your AC is drawing excessive current but your UPS should be able to take over if the voltage sag is that bad, so this can be treated as a separate issue.