I hope you are a troll. That is because if you are, we don't need to worry that you might do this.
If you are not a troll, your idea is a bad one and you are likely to end up dead of a lung expansion injury. A fundamental rule of scuba diving, is never hold your breath. This would apply any time anyone takes a breath of compressed air, as would be the case if you took a breath off of a spare air while under water. The air going into your lungs would be under pressure to compensate for the pressure created by whatever depth you were at. As you ascended, that would cause your lungs to expand and burst like a balloon. You probably would not feel the expansion until it was too late.
If you are going snorkeling, snorkel. If you want to use air out of a container, get scuba certified and do it right.