What was the first helicopter gunship?

The UH-1 Huey was fitted with guns and rockets during Vietnam, but the first true 'Attack' helicopter was a later variant called the Cobra. This used many of the basic components of the Huey.

Some of the UH-1s (Hueys) were later fitted with rockets and guns to fly escort for UH-1 troop carriers. In the 'gunship' role, the UH1 couldn't carry troops because of the weight. It was the first to be called a 'gunship' specifically, but that was simply to differentiate it from the standard utility UH-1s...despite that even they had a pintle mounted gun on each side. Despite what Hollywood might have us believe, the UH1 'gunship', like the ACH-47, wasn't effective enough in the attack role to be deployed in significant numbers, especially since UH-1s were in such high demand as transport aircraft.

The AH-1 Cobra was a purpose-built attack variant of the UH-1 that used the same powertrain as the UH-1, so it's a good example to see what makes an attack helicopter. The Cobra's flight crew sit fore and aft (like the Sioux above) to reduce the cross section presented to the enemy. It was built specifically as an attack helicopter at the expense of the utility role: it couldn't carry any logistical loads while armed, either internally or on a hook. The Cobra was indeed the first true 'gunship' and still serves in that role, mostly for allies of the US. It continues to be modernized and updated for the Marines as projected mission requirements change, including characteristics that we now see as essential to a modern 'gunship': twin engines, night operation, interoperability with ground forces, stand-off targeting, etc.