Which cog did you replace (2 main cogs which are prone to go)There's a Sundial cog behind which also goes.
There's a guide on here. Pretty much they melt over time with age. I've seen a few at wreckers and they just cack it.
The cog is the same as for the R31 pintara. You can buy them on ebay.
Hard to say if it is electrical. You are getting a signal for your speedo. If it was electrical, the speedo would drop out completely when you were driving for the cog not to work. Most likely the big cog like Habibosaurus said.