They're both technically coolant temperature sensors. Confusing I know. The inside one with the green wires is for the gage on the dash. The one you bought is the outer one, is dedicated only for the ECM. That's the latest part number showing for the sensor 19189478. The ECM basically looks at this sensor for coolant temperature if it's ABOVE or BELOW the fully warmed up temperature. I forget off hand what it needs to be. I think it's 170, but I could be wrong on that. If it's above, the ECM can go to closed loop if all other parameters say it's good to do so. PT169, GM#12101899 for the sensor connector for the one you bought.
The sensor for the gages (inside one next to water outlet) is the ACDelco #213-69 or GM#25036628. It probably has some yellow paint on top of it if original. Why, who knows. The green wired plug you have should swap right over to it. If it does not or if the wires are broken, a new plug connector is ACDelco #PT110, GM #12085488 should fix you up if you need one.