Something along these lines should do the trick:
extends Area2D
onready var the_sprite = get_node("path/to/sprite")
func _ready() -> void:
input_pickable = true
self.connect("input_event", self, "_on_Area2D_input_event")
func _on_Area2D_input_event(viewport: Node, event: InputEvent, shape_idx: int) -> void:
if event.is_action_pressed("mouseleft"): # set this up in project settings
the_sprite.visible = not the_sprite.visible