You can hook into ‘dynamic_sidebar’ action, which runs every time before widget is being viewed in front-end. It can be for example just a function with an incrementing global variable (if you don’t hate them too much :)).
Assuming there might be more than one sidebar, you’ll also need to reset the counter. You can possibly use ‘sidebars_widgets’ action hook for that.