When I test fit my rear window, once in final place I applied painter's tape to the outside along the edge of the skin. When I removed the window, I scuffed up the window below the tape and painted it.
When I do the final install of the window, after the aircraft has been painted, I will apply the sealant. With the painted portion on the inside next to the skin, the sealant will be hidden and that portion inside the cockpit will stay nice and shiny yet colored.