No, usually it won't get a counter, since when the check happens when, the spell isn't in the graveyard anymore (it's on the stack, see @Zags' answer). See the rulings below the card in Gatherer, which discuss this situation as well:
If you cast an instant or sorcery spell from your graveyard (due to an ability such as flashback, for example), Pyromancer Ascension’s first ability won’t trigger unless another card with the same name is in your graveyard.
Casting a spell via Flashback will always trigger Ascension's second ability.