No, normally GAP insurance will not kick in if your car is declared a total loss but your claim is denied for coverage or if you did not have primary insurance coverage on the vehicle in which to make a claim.
GAP insurance is supposed to pay the difference between the actual cash value (ACV) that the primary insurance carrier pays out for the loss of the vehicle and the amount left on your loan or lease, if you owe more than what the car is worth.
If there is no primary insurance pay off then GAP insurance usually will not be in effect. If your insurance company has turned down your claim or was not on the vehicle when it was in the incident that caused the total loss than ACV is not paid out and thus the "gap" is not there, just the full amount of your loan balance which GAP usually does not cover.
If you are in a situation where you need to know if your GAP insurance will be able to be used or not your should read through the terms of your GAP coverages and contact your GAP insurer to seek clarification.